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 override of event.target when preparing change events #24782
Conversation
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.
Thanks for the work!
Would you be so kind and add a test for this behavior. Otherwise we'll likely remove this code in the future since it's quite exotic.
ed19b17
to
0dddb00
Compare
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.
I have refined the solution, polished it a bit, and added a test case. It turns out that it only happens with the touch event, e.g. not the mouse down. I have added the target as the third property in case a developer has a specific use case that requires it, and done some other minor improvements.
e0d155c
to
a65cdd1
Compare
@eps1lon I have fixed your new test case, as well as on the Select component (both were indeed having a global side effect). I believe that the current tradeoff delivers. |
a65cdd1
to
cd81055
Compare
cd81055
to
89b3459
Compare
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.
Missing test in Select
packages/material-ui-unstyled/src/SliderUnstyled/SliderUnstyled.js
Outdated
Show resolved
Hide resolved
72432cb
to
0b4cf39
Compare
This reverts commit 4085c25.
0b4cf39
to
8050e5d
Compare
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.
Nice work!
@praveenkumar-kalidass Thanks for the work! |
What does it do?
Clones the event if it is a native event.
Why is it needed?
Not cloning the native event leads to event leaks to its parent.
Related issue(s)/PR(s)
Closes #24740