-
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
cdkDropList broken on touch devices on touchend #14390
Comments
@atscott what is the case in which the |
For a cdkDropList, it happens at the very end when you drop the element. This is a touchend event, which does not have any active touch points so the |
I think this could be solved simply with: |
You're doing the right thing to reproduce this bug. I don't think this bug is in the 7.1.1 release (even though that was created 2 days ago and the PR was submitted 7 days ago), but will be in the next release. I don't see the bug fix for that PR in the release notes and if I inspect the source, I don't see the call to _getPointerPositionOnPage in _cleanupDragArtifacts. |
Thanks, I see it when I run master. |
Fixes an error being thrown by `CdkDrag` when the `touchend` event fires. Fixes angular#14390.
Fixes an error being thrown by `CdkDrag` when the `touchend` event fires. Fixes angular#14390.
Fixes an error being thrown by `CdkDrag` when the `touchend` event fires. Fixes #14390. Marking as P2 since this will throw consistently on touch devices.
Fixes an error being thrown by `CdkDrag` when the `touchend` event fires. Fixes #14390. Marking as P2 since this will throw consistently on touch devices.
Fixes an error being thrown by `CdkDrag` when the `touchend` event fires. Fixes angular#14390. Marking as P2 since this will throw consistently on touch devices.
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. |
What is the expected behavior?
cdkDropList does not error
What is the current behavior?
The _cleanupDragArtifacts method now calls _getPointerPositionOnPage which does not handle touchend events correctly:
const point = this._isTouchEvent(event) ? event.touches[0] : event;
==> When the event is "touchend" the event.touches array is empty. Instead changedTouches has the Touch object you need.
Documentation for the touches array (key portion "touch points that are currently in contact"):
A TouchList listing all the Touch objects for touch points that are currently in contact with the touch surface, regardless of whether or not they've changed or what their target element was at touchstart time.
What are the steps to reproduce?
I don't think this is available as an npm yet, so I can't get a stackblitz.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
I believe this was caused by #14140 and affects all touch-based browsers
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: