components icon indicating copy to clipboard operation
components copied to clipboard

fix(drag-drop): fix drag start delay behavior to allow scrolling (#16224)

Open Aboisier opened this issue 5 years ago • 5 comments

I tried fixing the scrolling issue on mobile devices with my previous PR (#16228), but it did not work on iOS. There was also a bug with scrolling after the item has been dragged once. The native drag interactions were not toggled when the drag sequence is ended­.

In order to fix the iOS issue, we prevent default behaviour of pointer events fired after the drag sequence has been started instead of only initialized.

Aboisier avatar Jul 16 '19 18:07 Aboisier

Actually it seems like there is an issue with my solution. Sometimes, when you drag, it scrolls.

Aboisier avatar Jul 17 '19 12:07 Aboisier

@Aboisier, @crisbesto: at the moment, scrolling is not possible on iOS devices if cdkDragDelay is set and the touch starts on an element with cdkDrag. This is IMHO a real problem, as screen-filling drag items now prevent the user from using the page, as they can not scroll. Not setting cdkDragDelay is obviously not really a fix.

@Aboisier: Whats the state of this PR? Can I help you somehow? Are you still working on fixing the drag scroll behavior you mentioned in your last comment?

Edit: for everyone else: use a DragHandle to work around this problem!

trampi avatar Aug 08 '19 09:08 trampi

Hey @trampi , I don't think I will work on this PR in the near future. It seems like a change has been introduced between 8.0.2 and 8.1.0 and it's breaking my fix, so we are currently using a fork of 8.0.2 on which we applied #16228 and this PR. It's kind of stableish.

You're welcome to continue the work on this PR!

Aboisier avatar Aug 09 '19 12:08 Aboisier

Hi @Aboisier, I would love to but I lack the time, experience and knowledge about CDK. Thank you for your feedback!

trampi avatar Aug 13 '19 11:08 trampi

@crisbeto Can this fix be finished in order to fix this issue https://github.com/angular/components/issues/17923

plchampigny avatar May 07 '20 14:05 plchampigny