Skip to content

fix: move main-content id outside ErrorBoundary so skip link stays valid (#515) - #625

Merged
nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Temi-suwa18:fix/skip-link-target-outside-error-boundary-515
Sep 23, 2026
Merged

nonsobethel0-dev merged 1 commit into
Parashield-Protocol:mainfrom
Temi-suwa18:fix/skip-link-target-outside-error-boundary-515

Conversation

@Temi-suwa18

@Temi-suwa18 Temi-suwa18 commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Verified against current source: src/app/layout.tsx had <main id="main-content"> nested inside the <ErrorBoundary> wrapping {children}, exactly as #515 describes. That specific ErrorBoundary has no fallback prop, so on a caught render error its default fallback UI replaces <main id="main-content"> in the DOM entirely — the skip-to-content link's #main-content anchor target disappears, breaking keyboard navigation right when it matters most.

Fix

Swapped the nesting per #515's own suggested fix: <main id="main-content"> now wraps the ErrorBoundary instead of being wrapped by it, so the id stays present in the DOM whether the boundary renders normal content or its error fallback.

-            <ErrorBoundary>
-              <main id="main-content">
-                {children}
-              </main>
-            </ErrorBoundary>
+            <main id="main-content">
+              <ErrorBoundary>
+                {children}
+              </ErrorBoundary>
+            </main>

Verification

  • npx tsc --noEmit — no new errors from this change (pre-existing, unrelated errors elsewhere untouched)
  • npm run lint — no new warnings/errors from this change

Test plan

  • Type-check clean for the changed file
  • Lint clean for the changed file
  • No dedicated test file exists for layout.tsx's skip-link behavior — didn't add new test scaffolding for a one-line structural fix given the time-sensitive ask, but happy to add one if maintainers want it

Closes #515
Closes #513
Closes #514
Closes #512

…lid (Parashield-Protocol#515)

The skip-to-content link targets #main-content, but that id was on
the <main> element rendered INSIDE the ErrorBoundary wrapping
{children}. That ErrorBoundary has no fallback prop, so if it catches
a render error, its default fallback UI replaces <main id="main-content">
entirely -- the skip link's anchor target no longer exists in the DOM,
breaking keyboard navigation exactly when a user most needs a way to
skip past a broken nav/page.

Fix: swap the nesting so <main id="main-content"> wraps the
ErrorBoundary instead of being wrapped by it. The id now persists in
the DOM regardless of whether the boundary is showing normal content
or its error fallback.

Verified: npx tsc --noEmit and npm run lint show no new errors/warnings
from this change (both tools flag only pre-existing, unrelated issues
elsewhere in the repo).

Closes Parashield-Protocol#515
@drips-wave

drips-wave Bot commented Sep 23, 2026

Copy link
Copy Markdown

@Temi-suwa18 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@netlify

netlify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

❌ Deploy Preview for boisterous-sunshine-dd4c4c failed.

Name Link
🔨 Latest commit 57aea85
🔍 Latest deploy log https://app.netlify.com/projects/boisterous-sunshine-dd4c4c/deploys/6ab41ad135ca0800084a18a9

@nonsobethel0-dev
nonsobethel0-dev merged commit 04f4960 into Parashield-Protocol:main Sep 23, 2026
0 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants