Comments (4)
Hi @shfrmn, thanks for the kind words.
Not sure I agree there: there's no real usecase (for me) to force the drag to happen only after xx seconds no matter the intent of the user. Maybe you could elaborate your need?
Delay is here to help with a "click & hold to drag" scenario.
from use-gesture.
Hi @dbismut,
I agree with what you said in the context of desktop use, when the user is moving the mouse while pressing the left button it indeed means they are intending to drag the element. On the other hand on mobile enforcing delay would make it much easier to differentiate between swipe/scroll and drag. The UX of having to hold (as in long tap) the element for some time before it becomes draggable is pleasant and familiar to everyone (think iOS desktop icons).
I did not realize it was an enhancement because it's just one of those things I intuitively expected to work out of the box as an average library user, especially after seeing there's a delay option. It's a bit surprising no one else brought it up before.
No doubt, the behavior I'm talking about is already quite easy to implement in the userland, whether it should be a part of this library or not is not my call. However I'd be happy to help with implementation if it's deemed feasible.
from use-gesture.
P.S. I realized the way I opened the issue was probably confusing since I indicated MacOS as the environment. The main value of hard delay would actually be on mobile when there are two gestures registered in the same area. Since smartphone screen is small, the wider swiping gesture might sloppily start on top of a draggable element and having a hard delay would prevent the drag gesture from triggering completely. Hope the use case makes more sense now.
from use-gesture.
Actually no, what you're describing is not trivial to implement in user land (ie distinguishing between a vertical drag and a vertical scroll). But in that case I suggest you use https://use-gesture.netlify.app/docs/options/#preventscrollaxis which is made for this.
from use-gesture.
Related Issues (20)
- Pinch bug: after opening/closing context menu, pinching gesture can be fired with 1 finger HOT 1
- Delegate drag to remaining finger after pinch or support multi-finger drag HOT 5
- Using modifierKey causes the mac pinch event to return HOT 2
- Using pointer.touch cannot be dragged under windows system HOT 6
- useDrag breaks onClick listener in React portal to shadow dom HOT 2
- using video element inside useDrag component doesn't allow the video to play/pause using single click over the video HOT 6
- DragBounds ignored when rerender target HOT 1
- dynamically updating useDrags axis option resets movement : [mx,my] HOT 2
- Using alt+left for navigation prevents all gestures on elements with axis: 'y'
- Drag + Click + filtertaps option breaks onclick listener. Drag + Click + Treshold works. HOT 1
- touch-action: pan-y prevents L shaped gestures to scroll
- onPinch breaking on control + scroll HOT 5
- Where do I import a3f from? HOT 1
- Getting the error "a3f is not defined"
- Textarea doesn't work inside gesture container HOT 4
- Documentation website is broken (in firefox) HOT 8
- Type error with @types/react >=18.2.66
- (Firefox) Click event fired on drag end
- 100ms delay between pointermove events in Android webviews? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from use-gesture.