fix: validation added to fix a11y issue - #39125
jesusbalderramawgu wants to merge 2 commits into
Conversation
|
Thanks for the pull request, @jesusbalderramawgu! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. DetailsWhere can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
There was a problem hiding this comment.
🟢 Approval recommended
The change is small, localized, and consistent with the stated a11y goal, with only a minor maintainability nit noted.
Pull request overview
This PR adjusts LMS base template rendering to prevent an extra “Skip to main content” link from appearing in chromeless/iframe contexts (notably the Learning MFE unit iframe), aligning with the accessibility goal of having a single global skip link.
Changes:
- Conditionally renders the LMS skip link only when the LMS header is enabled.
- Prevents the skip link from appearing on pages rendered with
disable_header(commonly used for embedded/chromeless views).
File summaries
| File | Description |
|---|---|
lms/templates/main.html |
Wraps the LMS skip-link output in a not disable_header condition to avoid duplicate skip links in chromeless/iframe contexts. |
Review details
Suppressed comments (1)
lms/templates/main.html:210
- This introduces a second separate
if not disable_headerblock; the skip link can be placed inside the existing header guard to avoid duplicated conditionals and keep related header/chrome elements grouped together.
% if not disable_header:
<a class="nav-skip sr-only sr-only-focusable" href="#main">${_("Skip to main content")}</a>
% endif
% if not disable_header:
<%include file="${static.get_template_path('header.html')}" args="online_help_token=online_help_token" />
<%include file="/preview_menu.html" />
% endif
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Description
PR to fix an a11y issue, it closes this issue.
Issue
In summary we have currently two Skip links and we should have only one "globally"
Fix
Ensure the skip link targets the main content container using a valid anchor or focusable element at the start of the primary content region.
Testing instructions
Given you open a unit in the learning MFE at http:///learning/course/<course_id>/<sequence_id>/<unit_id>
When you press Tab from the address bar
Then
The first focusable element is the top-level "Skip to main content" link (from the MFE header).
Subsequent Tab presses go through the MFE header links and directly into the first control inside the unit iframe.
No second "Skip to main content" link appears between the header and the unit content.
DOM check: In DevTools, inspect iframe.unit-iframe > body. There must be no element.
Screenshots
Before the fix
After the fix