FormidableLabs / react-swipeable

React swipe event handler hook
https://commerce.nearform.com/open-source/react-swipeable
MIT License
2k stars 147 forks source link

💡 introduce a swipe duration prop #233

Closed hartzis closed 2 years ago

hartzis commented 3 years ago

We could introduce a similar prop to react-use-gesture's swipeDuration that may possibly alleviate a lot frustration devs have with tracking swipes correctly when users want to actually scroll.

By setting this prop to something "small" like react-use-gesture, 250ms, a swipe could be made more distinguishable vs a scroll. 🤔

This new prop swipeDuration could also be introduced in a backwards compatible way.

Or set a "sensible" default and bundle it with a new major version 💭

hartzis commented 2 years ago

I'd like to roll this out with a sensible default in the next major version. Based on the amazing work and research done by the use-gesture package and team, (pmndrs/use-gesture)[https://github.com/pmndrs/use-gesture], i feel confident that this change will most likely be an unnoticeable change for most and possibly even a slight improvement to many unknowingly.

I'll include some gifs of user experiences before and after this change in attempt to pursuade those who may be hesitant.

I'll try to get a PR open to the next major version branch, v7, later this year or early next year.

hartzis commented 2 years ago

Released with v7.0.0