[feature]: Add "labelInAriaLive"-property for better accessibility
What problem does this PR solve?
If the user moves between TreeSelect options using arrow keys, the screenreader will always read out the value of the active node. It would be much better for accessibility (and more flexible), if I as a developer could decide to use labels for aria-live content instead of the values.
What does the proposed API look like?
New prop would be labelInAriaLive, and it would be false by default. This prop would then be used to decide whether to use the value or label of the selected item, when rendering the aria-live tag of the component.
Using the component with the implemented feature:
<TreeSelect
labelInAriaLive={true} // This is the new prop
treeDefaultExpandAll
treeData={[{ value: 'parent', label: 'parent-label', children: [{ value: 'child', label: 'child-label' }] }]}
multiple
/>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
| Name | Status | Preview | Updated |
|---|---|---|---|
| tree-select | ✅ Ready (Inspect) | Visit Preview | Jul 29, 2022 at 5:37AM (UTC) |
Codecov Report
Merging #413 (92136b5) into master (50509e7) will not change coverage. The diff coverage is
100.00%.
:exclamation: Current head 92136b5 differs from pull request most recent head 82028b3. Consider uploading reports for the commit 82028b3 to get more accurate results
@@ Coverage Diff @@
## master #413 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 14 14
Lines 468 469 +1
Branches 133 136 +3
=========================================
+ Hits 468 469 +1
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/TreeSelect.tsx | 100.00% <ø> (ø) |
|
| src/TreeSelectContext.ts | 100.00% <ø> (ø) |
|
| src/OptionList.tsx | 100.00% <100.00%> (ø) |
:mega: Codecov can now indicate which changes are the most critical in Pull Requests. Learn more
Hi @zombieJ : Any idea when this feature would be merged and released?
This is very useful because some times the value is, for example, a hash or similar identifier, which isn't meaningful to the end user. Any issues with this improvement @zombieJ ?
Conflict!