-
Notifications
You must be signed in to change notification settings - Fork 221
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
refactor: Removing aria attributes from Banner component #2318
refactor: Removing aria attributes from Banner component #2318
Conversation
1 flaky test on run #6134 ↗︎
Details:
cypress/integration/Autocomplete.spec.ts • 1 flaky testThis comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
Hey @bstanton678 thanks for putting this up! I talked to Rusty, and correct me if I'm wrong but don't we want to still have an aria-labelledby when issticky is false? Maybe we can use something like https://github.com/Workday/canvas-kit/blob/master/modules/react/common/lib/styles/accessibleHide.ts on the ActionLabelText when isSticky is true and remove aria-labelledby when is sticky is true |
We can do it that way if we'd like, but I am having a difficult time seeing the "value" in the complexity. When we don't use any aria at all, we get the sum inner text of the button: "{LabelText} {ActionText}, button" With the aria: "{ActionText}, button, {LabelText}" Another consideration: if a consumer would like to provide any text alternative ( |
Change makes sense! I' wondering if this is a breaking change? If not, can see it going into |
I didn't think that it was a breaking change, but the Lint PR failed and told me to put it in major. So I just did what it told me. I am happy to change the base to master if that is what you recommend. :D |
Hey William, So I discussed with the team and we decided we should remove the So here's what needs to be done moving forward:
|
7bc7460
to
0a4eb15
Compare
Summary
The useBanner hook is adding the
aria-labelledby
andaria-describedby
properties to the Banner button element. I removed the call to the hook so the aria attributes are not applied.The Banner button is using
aria-labelledby
referencing the ActionText, andaria-describedby
referencing the LabelText sub-component. It is difficult to point to measurable "problems" with this, because it does sound nice with screen readers. WhenisSticky
prop is used, the ActionText disappears from the screen, while still being referenced as the main label for the button.This will break the experience for Dragon Dictation and Voice Control users because the visible LabelText is not being used as the accessible name of the button element.
Release Category
Components
BREAKING CHANGES
We have removed the useBanner hook, the only function of which was to add
aria-labelledby
andaria-describedby
references to the text inside of the Banner. This was not required for accessibility, and browsers can compute thename
of the Banner from the text given inside.Checklist
ready for review
has been added to PRFor the Reviewer
Where Should the Reviewer Start?
Only changed Banner.tsx; observed useBanner hook is returning the object with aria attributes;
Areas for Feedback? (optional)
Testing Manually
name:
computes with the button element inner text strings.isSticky
prop,name:
.Screenshots or GIFs (if applicable)
No change to the UI; aria does not impact UI.
Thank You Gif (optional)