-
-
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
[Slider] Save focus after click #15439
Conversation
Details of bundle changes.Comparing: c867c5f...5cc57ab
|
Better just set the focused state I'm not sure this solves #15316 though. I would've thought clicking the thumb already focuses it at which point keyboard navigation should "just" work. Maybe it's just an issue with even listeners attached to different targets. Feel free to work on this. |
So I found out that if I remove I am not sure if removing |
@jztang I think this is relevant if the slider is in a swipeable drawer but preventing default/bubbling is only necessary for pointer moves. Best remove the default prevention and push some code so we can look at the tests or deploy preview. |
I'd like to work on #15316, as it seems to be inactive. I tried to comment there but didn't get any response, so I'm hoping this PR will get someone's attention. I'm still new to this, so I'd like some guidance if possible.
From what I can tell, the focus is set using
handleFocus
:https://github.com/mui-org/material-ui/blob/947853d0fde0d3048f653069bb1febe6dbde9577/packages/material-ui-lab/src/Slider/Slider.js#L315-L317
When the slider thumb is clicked,
handleClick
is called:https://github.com/mui-org/material-ui/blob/947853d0fde0d3048f653069bb1febe6dbde9577/packages/material-ui-lab/src/Slider/Slider.js#L323-L329
So to fix this, do I just call
handleFocus
inhandleClick
?Fixes #15316