ismail9k / vue3-carousel

Vue 3 carousel component
https://ismail9k.github.io/vue3-carousel/
MIT License
660 stars 164 forks source link

Option to scroll after user has swiped #266

Closed axelkennedal closed 1 year ago

axelkennedal commented 1 year ago

Is your feature request related to a problem? Please describe. When a user on mobile tries to scroll up and down on a page which uses this carousel the contents of the carousel also begins to scroll - as it follows the swipe of the user while the user is swiping.

Describe the solution you'd like Add an option (boolean) to the Carousel component, e.g. slideAfterSwipe.

When false, don't change behaviour.

When true: The carousel should not scroll its slides while the user is swiping. Instead it should only perform scrolls after the user has made a complete swipe. This way it is easy for the Carousel to know if the user actually meant to scroll the carousel, or just scroll up and down on the page. An example of this is how the Bootstrap carousel works.

Describe alternatives you've considered I have proposed a small fix for the scrolling in mobile issue here. But it is not perfect.

Also, in addition to this feature fixing the scrolling issue, it is simply a new way to customize the behaviour of the carousel, which is nice.

Additional context N/a.

ismail9k commented 1 year ago

The carousel component now uses touch-action to controls scrolling when carousel drag