metafizzy / flickity

:leaves: Touch, responsive, flickable carousels
https://flickity.metafizzy.co
7.54k stars 602 forks source link

Undocumented scroll event argument positionX #943

Open 1deadpixl opened 5 years ago

1deadpixl commented 5 years ago

I stumbled onto the second argument passed to the scroll event, positionX, and am wondering if it's reliable to use it. It's not in the documentation, but it looks like it's been there since v2.0.0. Can I use this in production and not worry about it being removed in the future?

Here's the line where the scroll event gets returned with 2 arguments: progress, positionX https://github.com/metafizzy/flickity/blob/e2706840532c0ce9c4fc25832e810ad4f9823b61/js/animate.js#L94

Thanks!

desandro commented 5 years ago

Can I use this in production and not worry about it being removed in the future?

It may not be removed, but I may change how it is calculated. I think I wasn't 100% certain I provided a good measurement. It may not work with wrapAround.

mahnouel commented 4 years ago

Is wrapAround compatibility on the roadmap? 😬 Having issues with different outputs for keyboard navigation and dragging! Progress seems to be inconsistent, too.