-
Notifications
You must be signed in to change notification settings - Fork 839
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
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
#5995
Conversation
* Updating screen_reader_live to accept focus. * Added two tests for isFocusable behavior. * Adding documentation for isFocusable prop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome unit tests!
- 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 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/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Also confirmed that SR results for searchable EuiSelectable
are unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @1Copenut.
The color="ghost"
in EuiSkipLink
looks good to me! 🎉
Summary
Updated the
EuiScreenReaderLive
component to to accept anisFocusable
boolean 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