Skip to content
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

cdkDragStartDelay behavior has changed in version 8.1.0 #16614

Open
livthomas opened this issue Jul 26, 2019 · 6 comments
Open

cdkDragStartDelay behavior has changed in version 8.1.0 #16614

livthomas opened this issue Jul 26, 2019 · 6 comments
Labels
area: cdk/drag-drop P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@livthomas
Copy link
Contributor

It seems that the behavior of drag start delay has been changed between Angular CDK versions 8.0.0 and 8.1.0. I think this is a breaking change since it completely changes the way users interact with draggable items. I am not sure if the current behavior is really intended.

Reproduction

8.0.0: https://stackblitz.com/edit/angular-cdkdragstartdelay-80
8.1.0: https://stackblitz.com/edit/angular-cdkdragstartdelay-81

Steps to reproduce:

  1. Click on any item.
  2. Try to drag it as soon as possible.

Expected Behavior

In the previous version it did not matter if the mouse was clicked or immediately moved. The dragging started anyway after the specified delay.

Actual Behavior

In the current version the item is not being dragged when you move the mouse immediately after the initial click. It only works if you stay at the click position for the specified delay time and then move the mouse.

Environment

  • Angular: 8.0.0+
  • CDK/Material: 8.1.0+
  • Browser(s): Google Chrome
  • Operating System (e.g. Windows, macOS, Ubuntu): Fedora Linux 29
@Achilles1515
Copy link

Look at the release notes for 8.1.

  • drag-drop: fix drag start delay behavior to allow scrolling

@livthomas
Copy link
Contributor Author

@Achilles1515 Sure, I have seen that. I just wonder if this is the right behavior or if the fix could be implemented some other way.

@andrewseguin
Copy link
Contributor

@crisbeto Can you provide details on the intentions behind the delayed start and whether the change was intended?

@andrewseguin andrewseguin added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Jul 31, 2019
@crisbeto
Copy link
Member

crisbeto commented Aug 4, 2019

The change was intentional in #16228. I approved the PR because the change seemed reasonable, but I can see how the old behavior made sense as well.

@amitport
Copy link
Contributor

amitport commented Aug 15, 2019

I think both behaviors should be supported. I have another use-case for the old behavior (the one that only cares about time pressed not about where the mouse is):

Support click/doubleclick action on a draggable item.

If a user's intention is to doubleclick (triggering some automated action) I don't want her to see any movement of the item (which can happen without delay option). If a user wants to drag, she usually just drags away and expect the item to follow (maybe after a short delay, but we do not expect to have to stay on the item)

In any case, @andrewseguin @crisbeto shouldn't this be p2/regression since a valid behavior stopped working?

@zuzhal
Copy link

zuzhal commented Aug 2, 2022

Any news about this? I would also prefer to have a possibility to switch between these 2 behaviors as @livthomas suggested.
Can somebody give me hints on implementing the "old" behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: cdk/drag-drop P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

6 participants