-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
REDMOND\shwetasri
committed
Sep 20, 2024
1 parent
963ef5f
commit 1d3bc93
Showing
4 changed files
with
8 additions
and
14 deletions.
There are no files selected for viewing
14 changes: 4 additions & 10 deletions
14
...l-label-better-than-aria-suggestion-v9.md → ...sual-label-better-than-aria-suggestion.md
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 |
---|---|---|
@@ -1,29 +1,23 @@ | ||
# Accessibility: Visual labels should be preferred over aria-label (`@microsoft/fluentui-jsx-a11y/visual-label-better-than-aria-suggestion-v9`) | ||
# Accessibility: Visual labels should be preferred over aria-label (`@microsoft/fluentui-jsx-a11y/visual-label-better-than-aria-suggestion`) | ||
|
||
💼 This rule is enabled in the ✅ `recommended` config. | ||
|
||
<!-- end auto-generated rule header --> | ||
|
||
# This rule suggests that visual label is better than aria-label (`visual-label-better-than-aria-suggestion-v9`) | ||
|
||
For component like Dropdown, SpinButton, it's good to have a aria-label for screen reader users but visual labels are considered better because they're also useful for sighted user and comes in screen announcement as well. | ||
|
||
## Rule Details | ||
|
||
This rule aims to... | ||
This rule aims to encourage the usage of visual labels in place of aria-label | ||
|
||
Examples of **incorrect** code for this rule: | ||
|
||
```js | ||
|
||
```jsx | ||
<Dropdown aria-label="This is a Dropdown" /> | ||
|
||
``` | ||
|
||
Examples of **correct** code for this rule: | ||
|
||
```js | ||
|
||
```jsx | ||
<><Label id="my-dropdownid">This is the visual label</Label><Dropdown aria-labelledby="my-dropdownid" /></> | ||
|
||
``` |
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
File renamed without changes.
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