zillow / react-slider

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

Set the active handle in _forceValueFromPosition #39

Closed guillaumervls closed 5 years ago

guillaumervls commented 9 years ago

It's useful to get the moved handle in onChange (by looking for the active the class). BTW, a "cleaner" way to get this info would be nice ;) .

qwtel commented 9 years ago

Looking for the active class seems like a really bad way for doing this. Setting the active class in _forceValueFromPosition is wrong though, as the handle should only be active while being moved. Instead we should change the callback argument to an object that contains the value and the index.

guillaumervls commented 9 years ago

IMHO, the handle should be active as soon as you "mouse-down". So if active isn't set in _forceValueFromPosition, it should be somewhere else. Also I agree that onChange(value, index) would be nice.

stale[bot] commented 5 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.