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
CONSOLE-2396: Add skip to content component #6596
CONSOLE-2396: Add skip to content component #6596
Conversation
Hi @jessiehuff. Thanks for your PR. I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/hold |
Something I noticed in adding this component is that when the skip to content is used, it almost looks like a page refresh. I'm wondering if this has something to do with the way that routing is handled? I notice that this doesn't happen in any PF page demos with the skip to content. |
Yes, we use react-router. You see that when you use an |
Nice call out on that!! I created an issue in PF. It would make sense to me for our skip to content component to be able to accept other router components instead of always rendering as an anchor tag. I think we already do something similar in our Nav so I'm hoping it shouldn't be too difficult to add that. |
483fb76
to
a9ba397
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.
looks good thanks @jessiehuff
I've tested this update in VO, NVDA, and JAWS, and it seems to work in all three screen readers. |
Hi, @jessiehuff, do we still have the page refresh problem? Do we need to bump Patternfly? |
Hi @spadgett! I haven't seen the page refresh problem since updating the href to |
Does |
@spadgett Unfortunately that's what I was trying previously which gave me the refresh issue. I think OpenShift sets the base href here which becomes |
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
/ok-to-test |
frontend/public/components/app.jsx
Outdated
@@ -159,6 +159,11 @@ class App_ extends React.PureComponent { | |||
onPerspectiveSelected={this._onNavSelect} | |||
/> | |||
} | |||
skipToContent={ | |||
<SkipToContent href={`${this.props.location.pathname}#content`}> |
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 will drop any query parameters in the URL I believe.
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.
Very good point, I hadn't considered that. I just updated it to add that consideration!
a9ba397
to
a98234a
Compare
a98234a
to
9a9d49e
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.
/lgtm
/label qe-approved |
/label docs-approved |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jcaianirh, jessiehuff, spadgett, TheRealJon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/label px-approved |
/hold cancel |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
Currently keyboard users have to tab through the entire top nav and then the side nav in order to get to the main content. Adding a skip to content allows keyboard users to quickly and easily get to the main content of a page and helps support section 2.4.1 Bypass Blocks of WCAG and the VPAT. It's also only visible if you're using a keyboard so it shouldn't negatively affect anything visually. (When the page loads, press Tab. Focus should move to the skip to content component. Press enter and focus will shift to the main content.)
CONSOLE-2396