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

Wrong index in change event when changing thumb value through click #306

Open
curtisy1 opened this issue Sep 26, 2023 · 0 comments · May be fixed by #307
Open

Wrong index in change event when changing thumb value through click #306

curtisy1 opened this issue Sep 26, 2023 · 0 comments · May be fixed by #307

Comments

@curtisy1
Copy link

When having an array of values and moving one of the thumbs by clicking on the slider, the index is not set properly before triggering the change event.
Steps to reproduce in the CodeSandbox:

  • Open the Console Tab in the sandbox (or the browser dev tools)
  • Click on the slider, causing one thumb to change
  • The index will be -1 instead of 0 or 1 for the first click. All following indexes will have the index of the previous click

CodeSandbox

https://codesandbox.io/s/react-slider-bug-forked-9sckvq?file=/src/App.js

@curtisy1 curtisy1 linked a pull request Sep 26, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant