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.
should this say false instead of this.disabled?
There was a problem hiding this comment.
No, the handle should stay disabled if it is enabled while the drag item is disabled.
There was a problem hiding this comment.
Then should it also use this.disabled in disableHandle? seems odd that the methods aren't mirrored
There was a problem hiding this comment.
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.
Ok I think I understand it, just a little confusing at first sight
| this._disabledHandles.delete(handle); | ||
| if (this._disabledHandles.has(handle)) { | ||
| this._disabledHandles.delete(handle); | ||
| toggleNativeDragInteractions(handle, this.disabled); |
There was a problem hiding this comment.
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.