Skip to content

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

Open
@curtisy1

Description

@curtisy1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions