Update EuiScreenReaderLive and use it in EUI Docs to announce page loads to screen readers#5995
Update EuiScreenReaderLive and use it in EUI Docs to announce page loads to screen readers#59951Copenut merged 18 commits intoelastic:mainfrom 1Copenut:feature/tpierce-live-region-docs-ii
EuiScreenReaderLive and use it in EUI Docs to announce page loads to screen readers#5995Conversation
* Updating screen_reader_live to accept focus. * Added two tests for isFocusable behavior. * Adding documentation for isFocusable prop.
1Copenut
left a comment
There was a problem hiding this comment.
Left one comment about adding same page link EuiScreenReaderOnly text
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5995/ |
src/components/accessibility/screen_reader_live/screen_reader_live.tsx
Outdated
Show resolved
Hide resolved
src/components/accessibility/screen_reader_live/screen_reader_live.tsx
Outdated
Show resolved
Hide resolved
|
@constancecchen && @thompsongl I have a philosophical question RE this PR and the alternate take I proposed in #5991. This PR (5995) uses Greg's PR 5995 only fires I think this is okay, but wanted to get your thoughts. The alternate PR 5991 doesn't have this side effect because it uses a single status div and doesn't "juggle" two status live regions. 5991 depends on focus being set on a single |
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5995/ |
src/components/accessibility/screen_reader_live/screen_reader_live.tsx
Outdated
Show resolved
Hide resolved
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5995/ |
- actually revert guide_page_chrome to original code - fix scroll_to_hash comments, syntax
- DRY out ButtonColor typing - remove unnecessary `= 'primary'` fallback - EuiButton already has this by default, so passing undefined is fine
|
|
||
| const focusableDiv = component.find('div').at(0); | ||
|
|
||
| expect(focusableDiv.is(':focus')).toBe(true); |
- the component already extends `EuiButtonProps` and already accepts `color` with all the necessary typing, which I only just realized 🤦
Co-authored-by: Constance <constancecchen@users.noreply.github.com>
src/components/accessibility/screen_reader_live/screen_reader_live.tsx
Outdated
Show resolved
Hide resolved
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5995/ |
…live.tsx Co-authored-by: Constance <constancecchen@users.noreply.github.com>
…com/1Copenut/eui into feature/tpierce-live-region-docs-ii
cee-chen
left a comment
There was a problem hiding this comment.
🎉 This feels really robust and well tested - thanks for taking the extra time and effort on this Trevor!
|
Preview documentation changes for this PR: https://eui.elastic.co/pr_5995/ |
thompsongl
left a comment
There was a problem hiding this comment.
LGTM! Also confirmed that SR results for searchable EuiSelectable are unchanged.
elizabetdev
left a comment
There was a problem hiding this comment.
Thanks, @1Copenut.
The color="ghost" in EuiSkipLink looks good to me! 🎉
Summary
Updated the
EuiScreenReaderLivecomponent to to accept anisFocusableboolean prop. The change lets users set focus on the outer containing DIV, so we can use it as a consistent announcement for SPA route changes.This is a second PR that explores a different implementation of the same EUI Docs change as #5991. The second PR was prompted by @constancecchen comment here: #5991 (comment)
Checklist
Updated the Figma library counterpart