Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
luizcieslak opened this issue Oct 20, 2023 · 1 comment

Comments

@luizcieslak
Copy link

luizcieslak commented Oct 20, 2023

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

Steps:

  • scroll horizontally the page all until the end
  • click in the very end of the slider as you were selecting the ~100 value.
  • Instead of jumping to ~100, the slider goes to ~18.
  • Repeat steps and then the slider finally goes to ~100.
ssr-2023-10-20_15.10.30.mp4

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

@luizcieslak
Copy link
Author

luizcieslak commented Oct 20, 2023

after some digging:

const trackRect = trackElement.getBoundingClientRect();

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant