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

[Slider] Set onChangeCommitted to receive the last argument passed to onChange #44795

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

good-jinu
Copy link

@good-jinu good-jinu commented Dec 17, 2024

Demo: https://codesandbox.io/p/sandbox/nice-ully-k38gjr

The value is determined by the mouse position at the time onChange and onChangeCommitted are called. The discrepancy in the mouse position between the last onChange call and the onChangeCommitted call led to different argument values.

To address this, I've modified onChangeCommitted to always receive the last argument passed to onChange.

Closes #41739

@mui-bot
Copy link

mui-bot commented Dec 17, 2024

Netlify deploy preview

https://deploy-preview-44795--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 51f1489

@mnajdova mnajdova added bug 🐛 Something doesn't work component: slider This is the name of the generic UI component, not the React module! labels Dec 18, 2024
@mnajdova mnajdova requested a review from mj12albert December 18, 2024 12:25
@mj12albert mj12albert added the package: material-ui Specific to @mui/material label Dec 19, 2024
@good-jinu good-jinu force-pushed the slider-on-change-on-change-committed branch 3 times, most recently from 7e07151 to ab1e076 Compare December 20, 2024 00:55
- Add test case for differing values passed to onChange and onChangeCommitted in Slider
- Set onChangeCommitted callback in Slider to receive the last argument passed to onChange
@good-jinu good-jinu force-pushed the slider-on-change-on-change-committed branch from ab1e076 to 51f1489 Compare December 20, 2024 01:50
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Dec 23, 2024
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: material-ui Specific to @mui/material PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
4 participants