question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ability to delay dragging event by X milliseconds

See original GitHub issue

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

Set property to delay dragging event by X milliseconds <div cdkDrag cdkDragDelay="2000">Hold for 2 seconds to move this item</div>

What is the current behavior?

No option to prevent dragging on initial touch rendering this very hard to use on mobile. (This is certainly not helped by the fact that cdkDrag elements disable mobile scroll events)

What is the use-case or motivation for changing an existing behavior?

Currently click events immediately trigger leading to unintended re-ordering. Many sites and native devices solves this issue by not starting the drag event unless user have clicked and hold the object for a short amount of time.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

@angular/cdk: 7.0.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
philmtdcommented, Nov 4, 2018

I +1 this idea. I’d also suggest that in that case the px threshold should be bypassed so the user gets the drag preview right after the long-press (without the need to drag) to get immediate feedback that dragging is now enabled.

On the other hand a custom solution could probably be created once #13722 is merged. You’d then just manually need to handle the long-press and after that enable the dragging of that element.

Or you could use separate drag handles that are only active and visible on mobile devices.

0reactions
angular-automatic-lock-bot[bot]commented, Sep 10, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - Timer firing Tick event with 15 milliseconds delay
Any timers that I create, fire their tick event with 15 or 16 milliseconds delay. For instance, if I set the interval of...
Read more >
Common Action Options - interact.js
The action will start after the pointer is held down for the given number of milliseconds. inertia. Change inertia settings for drag, and...
Read more >
Handling Events :: Eloquent JavaScript
For example, we might want to respond to "mousemove" events by showing the current coordinates of the mouse but only every 250 milliseconds....
Read more >
HTML Drag and Drop API - MDN Web Docs
HTML drag-and-drop uses the DOM event model and drag events inherited ... dragged over a valid drop target, every few hundred milliseconds.
Read more >
Drag and Drop | Angular Material
Distance the user has dragged since the start of the dragging sequence. event. MouseEvent | TouchEvent = {} as any. Event that triggered...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found