remark icon indicating copy to clipboard operation
remark copied to clipboard

feat: add a function to throttle scrolling events

Open DaKoala opened this issue 6 years ago • 1 comments

In the remark slideshow. If you scroll on your touch pad even a little, the slides will go forward/back multiple slides. I add a function to throttle emitters of scrolling. Therefore, the slides will only change by 1 when a user scrolls.

DaKoala avatar Apr 21 '19 22:04 DaKoala

Instead of this throttle-based implementation, which essentially slows down all users, regardless of how fast they are actually trying to scroll, how about listening to wheel event, and then having some threshold of how far up or down (or left/right) until the slide changes? But care must be taken not to break mouse scroll (because mouse scroll does not have small steps like a touchpad), probably by also paying attention to deltaMode. Maybe we could also try listening to pointer events.

denilsonsa avatar Jan 17 '20 09:01 denilsonsa