-
-
Notifications
You must be signed in to change notification settings - Fork 79
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] Issues with adding focus-visible styles to the thumb slot #77
Comments
I see two potential solutions to fix the root issue here, each of them is going to require non-trivial refactoring of the
|
@danilo-leal @mnajdova we would like to pick this up |
Go for it. I'd assume that option 2, which @mnajdova has provided, is the preferred one to start exploring to solve this issue! |
The second approach faces a challenge as the focus and focus-visible selectors persist when the mouse moves out of the host element. A pseudo-CSS snippet attempts to have an insight into the behavior when we finally merge both the input and thumb and can directly use the pseudo-class on the input element as shown below, but it doesn't provide the desired solution. &:has(> input:focus-visible) {
// box-shadow styles;
} The reason why it seems when focus styles are added using the native
While we await feedback/more clarity on this, we would like to state that one potential solution is to remove the MUI focus-visible class onMouseUp |
In the new API this is solved by not exactly by merging the thumb and input into one, but instead just swapping their tabIndex and fixing up the handling of The (new) Thumb which is a Demo: https://deploy-preview-373--base-ui.netlify.app/experiments/slider/ |
As surfaced in mui/material-ui#40332, there seems to be a bug with the focus treatment for the Slider component.
Mui-focusVisible
through${sliderClasses.focusVisible}
. In that case, the problem is that they persist even if you move away from the thumb after clicking, dragging, and leaving it. That's illustrated in this comment: [base-ui][docs] Polish the Slider demos material-ui#40332 (comment)focus-visible
pseudo-class instead, the above-described behavior does not happen anymore. However, the problem then is that none of the styles appear if focusing/targeting the Slider's thumb using the keyboard.Search keywords: base-ui, slider, thumb, bug
The text was updated successfully, but these errors were encountered: