-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[SliderUnstyled] Fix disabledSwap
not being respected in onChangeCommitted
#32647
[SliderUnstyled] Fix disabledSwap
not being respected in onChangeCommitted
#32647
Conversation
move: true
to getFingerNewValue
to get previousIndex
for activeIndex
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add a test to verify the fix? It would also help to not have a regression in the future. Thank you!
…en Slider is with disableSwap
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the contributon! :)
move: true
to getFingerNewValue
to get previousIndex
for activeIndex
disabledSwap
not being respected in onChangeCommitted
Fixes #32381
Added
move: true
on getFingerNewValue in handleTouchEnd. Because at the 'touchEnd' the value is moved and we want to get 'previousIndex' for activeIndex. Not the 'closest'. (lines 418-422).