davidfig / pixi-scrollbox

a scrollbox built for pixi.js using a masked box that scrolls vertically and/or horizontally with optional scrollbars
https://www.npmjs.com/package/pixi-scrollbox
MIT License
171 stars 33 forks source link

Infinite scroll when `dragScroll` is disabled #27

Closed todoroff closed 3 years ago

todoroff commented 3 years ago

I'm only using a horizontal scrollbar and I'm getting an infinite scroll when I set dragScroll to false. In other words I can keep scrolling past the scrollWidth. I can scroll as much as I want to the left and until the scrollbar disappears to the right (but still well past the required scrollWidth).

I wonder if it could be related to the _bounds property's values, although those look exactly the same with or without drag enabled?

image

davidfig commented 3 years ago

Definitely a bug. I wasn't clamping the viewport when options.dragScroll=false. I fixed it in v2.2.1.

todoroff commented 3 years ago

Neat! Would you mind pushing it to npm as well? Cheers

davidfig commented 3 years ago

Weird. I thought I had published it to npm. It's now there as 2.2.1.