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

[SliderUnstyled] Fix disabledSwap not being respected in onChangeCommitted #32647

Merged
merged 3 commits into from
May 19, 2022

Conversation

JeanPetrov
Copy link
Contributor

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).

@mui-bot
Copy link

mui-bot commented May 6, 2022

Details of bundle changes

Generated by 🚫 dangerJS against 5ceaea4

@samuelsycamore samuelsycamore changed the title [SliderUnstyled] - Fixed geting corect activeIndex [SliderUnstyled] Add move: true to getFingerNewValue to get previousIndex for activeIndex May 6, 2022
@samuelsycamore samuelsycamore added package: base-ui Specific to @mui/base component: slider This is the name of the generic UI component, not the React module! labels May 6, 2022
Copy link
Member

@mnajdova mnajdova left a 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!

@mnajdova mnajdova added the PR: needs test The pull request can't be merged label May 18, 2022
@JeanPetrov JeanPetrov requested a review from mnajdova May 18, 2022 19:43
Copy link
Member

@mnajdova mnajdova left a 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! :)

@mnajdova mnajdova changed the title [SliderUnstyled] Add move: true to getFingerNewValue to get previousIndex for activeIndex [SliderUnstyled] Fix disabledSwap not being respected in onChangeCommitted May 19, 2022
@ZeeshanTamboli ZeeshanTamboli removed the PR: needs test The pull request can't be merged label May 19, 2022
@mnajdova mnajdova added the bug 🐛 Something doesn't work label May 19, 2022
@mnajdova mnajdova merged commit e6024d4 into mui:master May 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: slider This is the name of the generic UI component, not the React module! package: base-ui Specific to @mui/base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Slider] disableSwap prop is returning an incorrect value
5 participants