tajo / react-range

🎚️Range input with a slider. Accessible. Bring your own styles and markup.
https://react-range.pages.dev
MIT License
859 stars 97 forks source link

First onChange in a slider greater than the viewport not registering correctly #190

Open luizcieslak opened 1 year ago

luizcieslak commented 1 year ago

Hi! I noticed a minor issue in a slider when it is greater than the viewport width documented in this codesandbox.

Steps:

https://github.com/tajo/react-range/assets/14146176/d187bc81-c1ff-49a6-a437-35eb674a76b1

I haven't found the root cause yet and can update this issue later

luizcieslak commented 1 year ago

after some digging: https://github.com/tajo/react-range/blob/2a634cd56b40710fa9519fd20bb6385302a51045/src/Range.tsx#L147

inside the onMove function, the trackRect.left above doesn't update its value if you scroll the page before interacting with the range

ahsan-sabir commented 2 months ago

@luizcieslak have you found any workaround?

luizcieslak commented 1 month ago

I haven't @ahsan-sabir 😢