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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Rating] Use fieldset instead of span for the root element #44181

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

mnajdova
Copy link
Member

Using fieldset as a root of the Rating improves the a11y, as the component wraps multiple inputs with labels. I had to add some minimal styles to get to the same look as before.

On another note, while working on it, I noticed that we don't support the component prop here. I can add it in a separate PR, to allow people to opt into the old behavior if needed for some reason.

@mnajdova mnajdova added accessibility a11y component: rating This is the name of the generic UI component, not the React module! labels Oct 22, 2024
@mui-bot
Copy link

mui-bot commented Oct 22, 2024

Netlify deploy preview

https://deploy-preview-44181--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against e21687a

@sai6855
Copy link
Contributor

sai6855 commented Oct 22, 2024

Just curious, won't this be a breaking change for users who targets Rating using span?

@mnajdova
Copy link
Member Author

mnajdova commented Oct 22, 2024

Just curious, won't this be a breaking change for users who targets Rating using span?

Yep, it could break some apps. I was checking to see what it would take to make the change. It improves the accessibility tough. Maybe as a first step we can introduce a component prop so that people can fix this in their apps by using the fieldset prop, and change the default in the next major. @sai6855 would you be up to opening a PR for adding a support for the component prop separately?

@sai6855
Copy link
Contributor

sai6855 commented Oct 22, 2024

would you be up to opening a PR for adding a support for the component prop separately?

Yup, sure. I'll open

@mnajdova mnajdova added the on hold There is a blocker, we need to wait label Oct 30, 2024
@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Oct 30, 2024
@DiegoAndai DiegoAndai added this to the Material UI v7 (draft) milestone Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility a11y breaking change component: rating This is the name of the generic UI component, not the React module! on hold There is a blocker, we need to wait PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

4 participants