FormidableLabs / react-swipeable

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

[WIP] - replace preventDefaultTouchmoveEvent with touchEventOptions #235

Closed hartzis closed 3 years ago

hartzis commented 3 years ago

Attempt to remove preventDefaultTouchmoveEvent which has always been a very complicated and hard to describe prop and replace it with touchEventOptions.

Mimicking our good friends over at https://use-gesture.netlify.app/docs/options/#eventoptions

touchEventOptions: AddEventListenerOptions

Possible solution for both #224 and #231.

TODOs:

hartzis commented 3 years ago

Closing in favor of #240 and maintaining the ease provided by a prop to prevent scrolling.

After having a great discussion with @stefvhuynh about usability and interfaces we decided to move forward with a more user friendly prop that is explicit with it's intent, preventScrollOnSwipe.

We may also add these event options additionally to provide users with more power, but we can continue to investigate the need for that.