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

Use aria-describedby on checkboxes with descriptions #2079

Merged

Conversation

brockfanning
Copy link
Contributor

Fixes #2078

I should note that the problem this solves also affects other components, like the text input. But I wanted to start with a simpler case (checkboxes) before tackling that one, to make sure the team is OK with this approach.

@netlify
Copy link

netlify bot commented Jan 12, 2023

Deploy Preview for jsonforms-examples ready!

Name Link
🔨 Latest commit 326c3eb
🔍 Latest deploy log https://app.netlify.com/sites/jsonforms-examples/deploys/63da7cff798ca8000871033f
😎 Deploy Preview https://deploy-preview-2079--jsonforms-examples.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@sdirix
Copy link
Member

sdirix commented Jan 16, 2023

Thanks for the contribution!

@coveralls
Copy link

coveralls commented Jan 16, 2023

Coverage Status

Coverage: 83.193%. Remained the same when pulling 326c3eb on brockfanning:mui-checkbox-aria-describedby into 36e3732 on eclipsesource:master.

@brockfanning
Copy link
Contributor Author

@sdirix No problem! I need to make the same type of change for text inputs, but I wanted to make sure this approach (passing along the inputProps) is OK with you. Should I proceed?

@sdirix sdirix self-requested a review January 23, 2023 14:57
Copy link
Member

@sdirix sdirix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again! The code looks good.

I thought about whether it's worth to useMemo the inputProps objects but I actually think it's not necessary here. In almost all use cases the memo will not apply.

The only use case I could think of is when someone updates the JSON Schema at runtime with a new description. This is really an edge case, and if someone does that they probably don't care that the input is also rerendered (maybe there is even some additional memo barrier further within Material UI)

So the code looks good! However it would be nice if you could add test cases

@sdirix
Copy link
Member

sdirix commented Feb 1, 2023

@brockfanning Will you add a testcase?

@brockfanning
Copy link
Contributor Author

@sdirix I just pushed up a couple of tests - please let me know if that is not what you had in mind. I only did tests for MaterialBooleanToggleControl because I did not see any existing tests for MaterialBooleanControl. Did I miss those?

@sdirix sdirix merged commit 40f2263 into eclipsesource:master Feb 14, 2023
@sdirix
Copy link
Member

sdirix commented Feb 14, 2023

Thanks for the contribution ❤️ ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Screenreader support on MUI checkboxes with descriptions
3 participants