zillow / react-slider

Accessible, CSS agnostic, slider component for React.
https://zillow.github.io/react-slider
MIT License
890 stars 232 forks source link

feat: add pushed thumbs indices to on change events #232

Closed axelboc closed 3 years ago

axelboc commented 3 years ago

Fix #229

I didn't go for the solution of replacing the second argument of the on-change handlers with an array of indices. I thought someone may be interested in differentiating the thumb that the user interacted with directly from the thumbs that moved due to pearling.

So I added a third argument to onChange and onAfterChange: an array with only the thumbs that were pushed because of pearling. Note that in onChange, only the newly pushed thumbs are listed, whereas in onAfterChange, it's all the thumbs that were pushed throughout the user's entire interaction with the slider. Of course, since thumbs are pushed after onBeforeChange is called, this handler does not receive this third argument.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.