Skip to content

cdkDropList broken on touch devices on touchend #14390

Closed
@atscott

Description

@atscott

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?

Metadata

Metadata

Assignees

Labels

GThis is is related to a Google internal issueP2The issue is important to a large percentage of users, with a workaround

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions