baianat / hooper

🎠 A customizable accessible carousel slider optimized for Vue
https://baianat.github.io/hooper/
MIT License
718 stars 132 forks source link

feat: onWheel respects config.vertical value #218

Closed MacPrawn closed 3 years ago

MacPrawn commented 3 years ago

This PR makes sure the onWheel event considers the vertical option of the slider.

If vertical is true, only vertical wheel movements move the slider, and if false only horizontal wheel movements move the slider.

To be fully backwards, it may require adding a new option to control this feature or keep the previous behaviour, where wheel movements in any direction would move the slider.

A typical use case where one might want to disable vertical wheel movements is with a full width horizontal slider on a page: right now (before this PR) if your mouse is over the slider you can not move down on the page with the wheel as all your wheel movements are intercepted by the slider. The user has to move their mouse outside the slider (not always possible) in order to move up or down the page with their mouse wheel.

MacPrawn commented 3 years ago

Sorry - introduces some instability. Will work on it some more.