Skip to content

[RFR] BooleanField accessibility - #2744

Merged
fzaninotto merged 4 commits into
nextfrom
boolean-field-a11y
Jan 15, 2019
Merged

fzaninotto merged 4 commits into
nextfrom
boolean-field-a11y

Conversation

@djhi

@djhi djhi commented Jan 9, 2019 •

Copy link
Copy Markdown
Contributor

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
Comment thread docs/Fields.md Outdated
Comment thread packages/ra-core/src/util/getFieldLabelTranslationArgs.js
Comment thread packages/ra-ui-materialui/src/field/BooleanField.js Outdated
aria-label={ariaLabel}
{...sanitizeRestProps(rest)}
>
<span className={classes.label}>{ariaLabel}</span>

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

2 participants