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

[RFR] BooleanField accessibility #2744

Merged
merged 4 commits into from Jan 15, 2019
Merged

[RFR] BooleanField accessibility #2744

merged 4 commits into from Jan 15, 2019

Conversation

djhi
Copy link
Contributor

@djhi djhi commented Jan 9, 2019

Currently, there is no way for a screen reader or an e2e test to know what's the field value as it only contains an icon.

@djhi djhi added this to the 2.7.0 milestone Jan 9, 2019
docs/Fields.md Outdated Show resolved Hide resolved
packages/ra-ui-materialui/src/field/BooleanField.js Outdated Show resolved Hide resolved
{...sanitizeRestProps(rest)}
>
<span className={classes.label}>{ariaLabel}</span>
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this span since we have an aria-label?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I must say I'm not sure about the best practices here. I think label elements should only be used with interactive elements such as inputs or buttons. It made sense for me that it was true for aria-label attributes: https://w3c.github.io/using-aria/#label-support

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed the aria-label attribute

fzaninotto and others added 3 commits January 10, 2019 17:26
Co-Authored-By: djhi <gildas.garcia@pm.me>
@fzaninotto fzaninotto merged commit 735fc80 into next Jan 15, 2019
@fzaninotto fzaninotto deleted the boolean-field-a11y branch January 15, 2019 16:51
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.

None yet

2 participants