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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[material-ui][Button] Focus visible a11y issue #28543

Open
2 tasks done
sebascomeau opened this issue Sep 22, 2021 · 7 comments
Open
2 tasks done

[material-ui][Button] Focus visible a11y issue #28543

sebascomeau opened this issue Sep 22, 2021 · 7 comments
Assignees
Labels
accessibility a11y component: button This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer package: material-ui Specific to @mui/material

Comments

@sebascomeau
Copy link

sebascomeau commented Sep 22, 2021

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 馃槸

Button text color white with class Mui-focusVisible doesn't pass a11y.

image

https://color.a11y.com/ContrastPair/?bgcolor=5B93D3&fgcolor=ffffff

Steps to Reproduce 馃暪

Steps:

  1. go to https://mui.com/components/buttons/#main-content
  2. focus on contained button
@sebascomeau sebascomeau added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Sep 22, 2021
@mnajdova
Copy link
Member

cc @danilo-leal you may be interested in taking a look at this

@mnajdova mnajdova added accessibility a11y component: button This is the name of the generic UI component, not the React module! design: material This is about Material Design, please involve a visual or UX designer in the process and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Sep 24, 2021
@danilo-leal
Copy link
Contributor

cc @danilo-leal you may be interested in taking a look at this

@mnajdova The ripple focus color is defined automatically with opacity on the theme, isn't it?! I guess that reducing the opacity a bit would tackle this the right way.

@sebascomeau
Copy link
Author

We disabled focus ripple on buttons at createTheme level and also set MuiButton.root outline to undefined to let the browser handle the outline for a11y. I think reducing the opacity could pass the a11y.

@eps1lon
Copy link
Member

eps1lon commented Sep 30, 2021

Note that the contrast ratio may have to hit 3:1 to pass WCAG 2.2 AA: https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum.html

I'm not sure if a smaller area that is that thick is sufficient.

@schopra8
Copy link

Hi team, is there any workaround at the moment that allows us to change the opacity used in the ripple effect? Thanks, in advance!

@mnajdova
Copy link
Member

@schopra8 you can override it by adding the touch ripple classes, here is a short demo: https://codesandbox.io/s/affectionate-jerry-7uqf81?file=/src/App.tsx

You can check the TouchRipple.js source for more info/inspiration.

@ranjithsai
Copy link

@mnajdova @danilo-leal I guess reducing the opacity for ripple effect would meet contrast ratio. But then what about WCAG 2.4.11 focus appearance? I see these examples from WCAG guidelines clearly showing how it can be. I'm trying to understand where the current MUI buttons stand among these examples.

https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance-minimum.html

@zanivan zanivan assigned zanivan and unassigned danilo-leal Dec 4, 2023
@zanivan zanivan added package: material-ui Specific to @mui/material design This is about UI or UX design, please involve a designer and removed design: material This is about Material Design, please involve a visual or UX designer in the process labels Dec 4, 2023
@zanivan zanivan changed the title Button focus visible a11y issue [material-ui][Button] Focus visible a11y issue Dec 4, 2023
@zanivan zanivan added this to the Material UI v6 milestone Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y component: button This is the name of the generic UI component, not the React module! design This is about UI or UX design, please involve a designer package: material-ui Specific to @mui/material
Projects
Status: Backlog
Development

No branches or pull requests

8 participants