-
Notifications
You must be signed in to change notification settings - Fork 355
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
fix(page): skip to content should point to primary content container #2519
fix(page): skip to content should point to primary content container #2519
Conversation
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! We should also ensure this gets updated in core and documented on the site.
PatternFly-React preview: https://patternfly-react-pr-2519.surge.sh |
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.
Looks good, can you also update the page demos
67ea462
to
6a1458f
Compare
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 is awesome! Thanks for all your work researching this piece and contributing it back.
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.
Looks great so far @seanforyou23 do you mind opening a React issue for tracking purposes.
I had one question. If mainContainerId is not set by consumer, does this work as expected? Maybe we need to add in a test for that?
@tlabaj good catch, I updated the tests to reflect what we can expect in the current state. If users don't supply a |
@seanforyou23 let's open a follow up issue to make that required so we can pull that into the next breaking change release. |
@seanforyou23 I opened issue #2597 for the breaking change. |
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
Your changes have been released in:
Thanks for your contribution! 🎉 |
What: Currently, skip to content link sends users to an in-page anchor that sits alongside the main page content container. This generally has the desired effect for sighted keyboard users, however, for screen reader users (SRU) this basically leads to a dead end. It's a dead-end in that the target anchor doesn't contain the page content, so nothing further is announced after the element has been focused.
I think what would be better is if we allow the main content container to carry an id, which can be used as the target of the
SkipToContent
component. Doing this along with supplying atabindex="-1"
for the main content area gives us a solid hook for informing SRU of general route changes and informing them of what content is now available.For sighted users, I don't think this will cause any difference in behavior (we may want to add a style like
outline: none
to the primary page container, although I don't recommend this.Additional issues: #2591
These changes are driven by a technique suggested in https://dequeuniversity.com where in response to dynamic content changes (like navigating to a new "Page" in a SPA) we want to send focus to the new content so that it is announced and SRU receive some feedback about the new content.