-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(drag-drop): handle list and viewport auto scroll regions overlapping #16675
fix(drag-drop): handle list and viewport auto scroll regions overlapping #16675
Conversation
The way auto-scrolling is currently set up is that we have regions that are X% of the width/height of a node and whenever the user's pointer gets into the region, we start scrolling either the element or the page. The problem with our current approach is that as soon we find that the user's pointer is in one node's scroll region, we disregard any of the other scroll regions and we start scrolling, even if the element can't actually scroll. This is problematic in cases where the scroll list might be close to the viewport's edge and thus it could have its region overlapping with the viewport's. These changes address the issue in two ways: 1. We have the list's scroll regions take precedence over the ones of the page. 2. If the regions overlap, we check whether the element can continue scrolling that direction and if it can't, we start scrolling the page. Fixes angular#16647.
1b8a5b4
to
1122bb1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
||
/** | ||
* Gets the directions in which an element node should be scrolled, | ||
* assuming that the user's pointer is already within it scrollable region. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"within it scrollable region" -> "within its scrollable region" ?
…ing (angular#16675) The way auto-scrolling is currently set up is that we have regions that are X% of the width/height of a node and whenever the user's pointer gets into the region, we start scrolling either the element or the page. The problem with our current approach is that as soon we find that the user's pointer is in one node's scroll region, we disregard any of the other scroll regions and we start scrolling, even if the element can't actually scroll. This is problematic in cases where the scroll list might be close to the viewport's edge and thus it could have its region overlapping with the viewport's. These changes address the issue in two ways: 1. We have the list's scroll regions take precedence over the ones of the page. 2. If the regions overlap, we check whether the element can continue scrolling that direction and if it can't, we start scrolling the page. Fixes angular#16647.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
The way auto-scrolling is currently set up is that we have regions that are X% of the width/height of a node and whenever the user's pointer gets into the region, we start scrolling either the element or the page. It looks something like this where red are the regions of the list and green are the ones of the page:
The problem with our current approach is that as soon we find that the user's pointer is in one node's scroll regions, we disregard any of the other scroll regions and we start scrolling, even if the element can't actually scroll. This is problematic in cases where the scroll list might be close to the viewport's edge and thus it could have its region overlapping with the viewport's. These changes address the issue in two ways:
Fixes #16647.