NickPiscitelli / Glider.js

A fast, lightweight, dependency free, native scrolling carousel alternative!
https://nickpiscitelli.github.io/Glider.js
MIT License
3.26k stars 296 forks source link

Allow continued scrolling when click originates in glider container #30

Open DamSenViet opened 5 years ago

DamSenViet commented 5 years ago

I noticed that when you scroll in glider (holding down mouse-click)and leave the container but still hold down the mouse it stops the scrolling, which I find undesirable on desktop. Any way we could get continued scrolling even when leaving the container? Touch events seem to work that way, thought it might be nice to be consistent.

NickPiscitelli commented 5 years ago

Hi Viet,

Thanks for reporting the issue. To clarify, under what specific circumstances does this issue occur? Is this when using native browser scrolling and clicking the scrollbar or are you referring to the dragging functionality?

On Sun, Dec 30, 2018 at 12:50 AM Viet Tran notifications@github.com wrote:

I noticed that when you scroll in glider (holding down mouse-click)and leave the container but still hold down the mouse it stops the scrolling, which I find undesirable on desktop. Any way we could get continued scrolling even when leaving the container? Touch events seem to work that way, thought it might be nice to be consistent.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/NickPiscitelli/Glider.js/issues/30, or mute the thread https://github.com/notifications/unsubscribe-auth/ABm9lYKVfb_mVcNbhQU4WQAtIojKvG23ks5u-FQwgaJpZM4Zk0vZ .

DamSenViet commented 5 years ago

I'm referring to the dragging functionality. On the latest version of chrome on macOS. To replicate:

  1. click and hold on a slide (on your demo pages in a draggable configured glider)

  2. drag mouse outside of glider

NickPiscitelli commented 5 years ago

Yeah, I see what you mean. It's because the mouse event is bound to the slider itself. It's possible I could bind to the document and check the position of the mouse.

DamSenViet commented 5 years ago

You would still have to figure out which glider the click originated from to implement this. You could scope a variable into the module to determine what the last glider was. For the document on mouseup or hoverout, you can reset the variable to null. On mousemove for the document, so long as it's held down, can continue moving the glider that the variable points to.