-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor!: Removing aria attributes from Banner component (#2318)
The useBanner hook is adding the `aria-labelledby` and `aria-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, and `aria-describedby` referencing the LabelText sub-component. It is difficult to point to measurable "problems" with this, because it does sound nice with screen readers. When `isSticky` 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. [category:Components] ### BREAKING CHANGES We have removed the useBanner hook, the only function of which was to add `aria-labelledby` and `aria-describedby` references to the text inside of the Banner. This was not required for accessibility, and browsers can compute the `name` of the Banner from the text given inside. Co-authored-by: @mannycarrera4 <[email protected]> Co-authored-by: manuel.carrera <[email protected]>
- Loading branch information
1 parent
b0ece1d
commit 9a26501
Showing
7 changed files
with
31 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
|
||
import {Banner} from '@workday/canvas-kit-react/banner'; | ||
import {Tooltip} from '@workday/canvas-kit-react/tooltip'; | ||
import {styled} from '@workday/canvas-kit-react/common'; | ||
|
||
export const IconBanner = () => { | ||
|
||
return ( | ||
<Tooltip title="Warning"> | ||
<Banner width="4em"> | ||
<Banner.Icon /> | ||
</Banner> | ||
</Tooltip> | ||
); | ||
}; |