-
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(cdk/drag-drop): don't disable native dragging on inactive handles #20991
fix(cdk/drag-drop): don't disable native dragging on inactive handles #20991
Conversation
Currently we disable native drag interactions on handles once when they're registered, however this can block scrolling on mobile devices if the handle is inactive (either it is disabled or the drag element is disabled). These changes toggle the state dynamically depending on the active state. Fixes angular#20974.
this._disabledHandles.delete(handle); | ||
if (this._disabledHandles.has(handle)) { | ||
this._disabledHandles.delete(handle); | ||
toggleNativeDragInteractions(handle, this.disabled); |
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.
should this say false
instead of this.disabled
?
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.
No, the handle should stay disabled if it is enabled while the drag item is disabled.
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.
Then should it also use this.disabled
in disableHandle
? seems odd that the methods aren't mirrored
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.
No since disableHandle
only disables the handle, not the entire draggable item. A handle is considered "inactive" if either it is disabled or the item is disabled. This might be slightly confusing since toggleNativeDragInteractions(true)
means that interactions should be enabled which is true when dragging is disabled.
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.
Ok I think I understand it, just a little confusing at first sight
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
this._disabledHandles.delete(handle); | ||
if (this._disabledHandles.has(handle)) { | ||
this._disabledHandles.delete(handle); | ||
toggleNativeDragInteractions(handle, this.disabled); |
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.
Ok I think I understand it, just a little confusing at first sight
…#20991) Currently we disable native drag interactions on handles once when they're registered, however this can block scrolling on mobile devices if the handle is inactive (either it is disabled or the drag element is disabled). These changes toggle the state dynamically depending on the active state. Fixes #20974. (cherry picked from commit f133210)
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. |
Currently we disable native drag interactions on handles once when they're registered, however this can block scrolling on mobile devices if the handle is inactive (either it is disabled or the drag element is disabled).
These changes toggle the state dynamically depending on the active state.
Fixes #20974.