-
-
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][Select] Improve a11y by adding combobox role and aria-controls attribute #38785
[material-ui][Select] Improve a11y by adding combobox role and aria-controls attribute #38785
Conversation
…ls attribute Resolves: mui#35586
Netlify deploy previewhttps://deploy-preview-38785--material-ui.netlify.app/ Bundle size reportDetails of bundle changes (Toolpad) |
Hey @xulingzhihou, thanks for working on this!
|
@DiegoAndai thanks for your feedback. I am very new to this repo and I want to clarify something here:
|
@xulingzhihou thank you for taking an interest in contributing to Material UI 😊
Sorry, I got confused. Don't consider my Native Select component comment 😅 I confused the
The Finally, I think the I don't know why we have the hidden input 🤔 @mui/core, does anyone know the use of this element? |
Form auto-fill support, Form post support |
@xulingzhihou let me know if you need help with the failing tests |
Hey @xulingzhihou, is this ready for review? 😊 Could you provide an example with the before and after to make this review easier? To do so, you can provide the same example in these different environments:
This should allow us to see the correct role and |
@DiegoAndai yes it is ready for review! Here are the examples requested:
|
packages/mui-material-next/src/TablePagination/TablePagination.test.js
Outdated
Show resolved
Hide resolved
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.
This is ready to merge. There is just one last small change to clean up some comments fixed with this PR 🚀
To fix the Argos failures, we'll have to merge the updated master branch into this branch before merging the PR. Feel free to let me know if you need help with this.
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.
Ready to merge 🎉
Great work 🙌🏼
I'll merge as soon as the CI passes
Thank you for helping me with my first mui pr @DiegoAndai !! |
return ( | ||
<React.Fragment> | ||
<SelectSelect | ||
ref={handleDisplayRef} | ||
tabIndex={tabIndex} | ||
role="button" | ||
role="combobox" |
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.
Shouldn't this be considered a breaking change, so it should be a minor version change instead of a patch change?
v5.14.11 -> v5.15.0
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.
Hi! It's an a11y bug fix; the "button"
role was incorrect, so I think it falls under a patch version. Also, this should keep functionality intact; tests should only be impacted by how the component is selected. Please let me know if this is not the case for you 😊
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.
The unit tests on the app that I'm working on broke because of this change when bumping MUI patch versions. Please do consider bumping the minor next time instead when making such a change
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.
This was an absolutely awful decision. The notes on 5.14.12 did not detail that this would be a breaking change. It should have been called out immediately. I am working on an enterprise application with thousands of tests. Now they are all broken because of this one change that was supposedly "minor." How can we rely on a library that may break functionality on patch updates?
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.
Hey @Lori-Becker and @mrharispe, I'm sorry for the inconvenience this might've caused. We will learn from this and be more careful moving forward. Thank you for using the library and providing feedback.
Resolves: #35586
Changelog instructions
If your tests require selecting the triggering element by the
"button"
role, then you'll have to change it to use"combobox"