Skip to content
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

Merged

Conversation

jessiehuff
Copy link
Contributor

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

@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Sep 11, 2020
@openshift-ci-robot openshift-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 11, 2020
@openshift-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@jcaianirh
Copy link
Member

/hold

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 11, 2020
@jessiehuff
Copy link
Contributor Author

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.

Screen Recording 2020-09-11 at 9 46 47 AM

@spadgett
Copy link
Member

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?

Yes, we use react-router. You see that when you use an a element instead of Link. You probably need to use HashLink in this case. If the PF component doesn't allow it -- it looks like it doesn't -- we might have to roll our own.

@jessiehuff
Copy link
Contributor Author

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.

Copy link
Member

@jcaianirh jcaianirh left a 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

@spadgett spadgett changed the title Add skip to content component CONSOLE-2396: Add skip to content component Oct 13, 2020
@spadgett spadgett added this to the v4.7 milestone Oct 13, 2020
@jessiehuff
Copy link
Contributor Author

I've tested this update in VO, NVDA, and JAWS, and it seems to work in all three screen readers.

@spadgett
Copy link
Member

Hi, @jessiehuff, do we still have the page refresh problem? Do we need to bump Patternfly?

@jessiehuff
Copy link
Contributor Author

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 href={`${this.props.location.pathname}#content`}. After looking into it on the patternfly side, someone from the team noticed that it likely wasn't originally working because of the <base href="/" /> tag that OpenShift includes. I don't think we'll need to bump patternfly.

@spadgett
Copy link
Member

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 href={`${this.props.location.pathname}#content`}. After looking into it on the patternfly side, someone from the team noticed that it likely wasn't originally working because of the <base href="/" /> tag that OpenShift includes. I don't think we'll need to bump patternfly.

Does href="#content" work?

@jessiehuff
Copy link
Contributor Author

@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 <base href="/" /> so that when I use the relative anchor tag like href="#content" on child routes like /dashboard it becomes /#content instead of /dashboard#content.

Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 7, 2021
@spadgett
Copy link
Member

spadgett commented Jan 8, 2021

/ok-to-test
/retest

@openshift-ci-robot openshift-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2021
@@ -159,6 +159,11 @@ class App_ extends React.PureComponent {
onPerspectiveSelected={this._onNavSelect}
/>
}
skipToContent={
<SkipToContent href={`${this.props.location.pathname}#content`}>
Copy link
Member

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.

Copy link
Contributor Author

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!

@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2021
@TheRealJon TheRealJon self-requested a review January 12, 2021 19:10
@TheRealJon TheRealJon removed their assignment Jan 12, 2021
Copy link
Member

@TheRealJon TheRealJon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 12, 2021
@yapei
Copy link
Contributor

yapei commented Jan 13, 2021

/label qe-approved

@openshift-ci-robot openshift-ci-robot added the qe-approved Signifies that QE has signed off on this PR label Jan 13, 2021
@ahardin-rh
Copy link

/label docs-approved

@openshift-ci-robot openshift-ci-robot added the docs-approved Signifies that Docs has signed off on this PR label Jan 14, 2021
@spadgett
Copy link
Member

/approve

@openshift-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 14, 2021
@reestr
Copy link

reestr commented Jan 15, 2021

/label px-approved

@openshift-ci-robot openshift-ci-robot added the px-approved Signifies that Product Support has signed off on this PR label Jan 15, 2021
@spadgett
Copy link
Member

/hold cancel

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 15, 2021
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit 13a53ac into openshift:master Jan 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants