-
-
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
[material-ui][Button] Provide an accessible focus alternative when disableRipple
prop is set
#35843
Comments
:focus
alternative when disableRipple
property on the MuiButtonBase
is on!disableRipple
property on the MuiButtonBase
is on!
@dimitur2204 Sorry for the dull question but why do we want to disable the standard ripple effect instead of customizing it to our needs for example? Here's a simple example https://codesandbox.io/s/mui-change-global-ripple-color-forked-zk0xr3 |
@kachar The ripple controls both the click ripple and the focus ripple. It's a common case to not want the click ripple, but by doing that you render everything that uses the focus ripple inaccessible |
@michaldudak It seems like it is stated in the API for the Button Base https://mui.com/material-ui/api/button-base/#props. |
As you noticed, it is an expected and documented behavior. If you disable the ripple, you have to provide your own styles for the focus state. |
disableRipple
property on the MuiButtonBase
is on!disableRipple
property is set
disableRipple
property is setdisableRipple
prop is set
What's the problem? 🤔
When you use the
disableRipple: true
, property on thetheme.components
as suchThen all of the components that rely on the
Mui-focusVisible
class for ripple styling become unaccessible. When you focus them with keyboard nothing happens, you can't tell they are focused.What are the requirements? ❓
There needs to be some kind of fallback on that. I did that in my app and was left scratching my head for a while, why nothing is working, including:
What are our options? 💡
What I have done in my app is a global style to the:
There should be some fallback
Proposed solution 🟢
I am unaware of the internals of MUI and someone with more knowledge should propose a solution. My solution to my application is what I wrote in the "What are our options? 💡" section.
Resources and benchmarks 🔗
No response
The text was updated successfully, but these errors were encountered: