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
[Slider] Fix incorrect marks displayed due to duplicate keys in range #33526
Conversation
Thanks! Could you please check if this issue appears also in unit test and, if yes, create a test that verifies the fix? |
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.
It's a great first pull request in MUI 👌 Thanks a lot for working on it! I've added a test to ensure we won't create a regression in the future.
Nice bug fix 👌, I didn't anticipate this when I wrote the logic in #15703. I cleaned up a bit the label and PR title |
Fixes #31960
Description of the issue
Issue is caused when slider has more than one mark with the same value causing a duplicate key error. For example, when the lower limit and the upper limit thumbs in the range slider (marks are displayed for the thumb positions) are placed at the same position 100, both thumbs have the same key
100
, causing issues with rendering sliders marks correctly.What fix was adopted?
The fix was to replace the key value to mark index instead of mark value.