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

fix: update skip nav destination #1516

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

KristinAoki
Copy link
Member

Description

This PR moves the target ID for the skip nav button from the <main> tag to the children wrapper. This allows the skip nav to skip the secondary navigation of the page tabs.

Supporting Information

JIRA Ticket: AU-1333 🔒

In the Learning MFE, the skip-nav in the outer most scope (the Learning MFE,) must redirect to the main content of the currently displayed sub-section, when in-courseware. If in a MFE page (Home, Progress, Grading, etc.) the skip-nav should point to main content for page.

In most webpages, the SkipNav link jumps keyboard focus over the main header, which typically contains a lot of redundant navigation links or menus. The SkipNav link is intended to save keystrokes for keyboard-only users (including but not limited to screen reader users). The gist of this issue is that the Learning MFE is kinda special, in that the top of the <main> element – the most common destination for SkipNav links – is not the location of the main content; there is another layer of navigation elements in the Learning MFE (the Course, Progress, Dates etc. tabset).

Testing

For the outline, progress, and dates tabs and the course content page run the following tests

  1. Reload the page to reset keyboard focus to the top of the page.
  2. Using your keyboard, navigate through the page until you activate the "Skip to main content" button
  3. Click the button
  4. Confirm that the page is navigate to the after the pages tabs

Copy link

codecov bot commented Nov 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.25%. Comparing base (0effb32) to head (79a3bf4).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1516      +/-   ##
==========================================
+ Coverage   89.23%   89.25%   +0.01%     
==========================================
  Files         317      318       +1     
  Lines        5557     5563       +6     
  Branches     1341     1379      +38     
==========================================
+ Hits         4959     4965       +6     
+ Misses        583      582       -1     
- Partials       15       16       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -69,7 +69,7 @@ const LoadedTabPage = ({
streakDiscountCouponEnabled={streakDiscountCouponEnabled}
verifiedMode={verifiedMode}
/>
<main id="main-content" className="d-flex flex-column flex-grow-1">
<main className="d-flex flex-column flex-grow-1">
Copy link
Member

Choose a reason for hiding this comment

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

Odd that the main content is not in the same thing as the main element.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is unique here because of the second layer of navigation in the learning MFE. We have to move the target because we want to have the tabs inside the <main> tag but skip over it when using the skip nav function.

@KristinAoki KristinAoki merged commit 2ff8c39 into master Nov 12, 2024
7 checks passed
@KristinAoki KristinAoki deleted the KristinAoki/fix-skip-nav-to-page-content branch November 12, 2024 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants