Repository navigation
fix: portal keyboard shortcuts overlay out of blurred header - #837
Merged
Kingsman-99 merged 1 commit intoSep 28, 2026
Merged
Kingsman-99 merged 1 commit into
Kingsman-99 merged 1 commit into
Conversation
|
@therealbibson is attempting to deploy a commit to the kingsman-99's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@therealbibson 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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Makes the header
?button actually surface the shortcut reference overlay.The button, the modal and the
ShortcutRegistrywiring already existed onmain(landed with the keyboard-shortcuts overlay work), which is why this looked done — but clicking the button still failed to produce a usable overlay. The overlay isfixed inset-0, and it is mounted fromHeaderShortcutsButton, which lives insideNavbar's<header>:A
backdrop-filterother thannonemakes an element a containing block forposition: fixeddescendants. So the overlay'sinset-0resolved against the header box, not the viewport, and the dialog was clipped into the header strip. Itsz-50also only competed inside the header's own (z-40) stacking context, so the backdrop could never cover the page. From a user's point of view the button did nothing.This PR portals the overlay to
document.bodyso it escapes that containing block and stacking context, and hardens the category grouping while it is there.Related Issue
Closes #658
Changes
[MODIFY]
src/components/KeyboardShortcutsModal.tsxcreatePortal(..., document.body)behind a mount guard, so the overlay is no longer a descendant of the blurred header andfixed inset-0resolves against the viewport. Closing behaviour is unchanged — the sameonCloseis still wired to the backdrop, the close button andFocusTrap's Escape handler.groupShortcutsnow derives a rank from the data instead of leaking registration order. Categories lead in the order the issue documents (Navigation, Invoices, Payments), any other category follows alphabetically, andGeneralis always last so it never crowds out real categories.id={kbd-group-${group}}. A category containing a space madearia-labelledbya token list that resolved to nothing, silently dropping the section's accessible name. Ids are now slugified (Zebra Extras→kbd-group-zebra-extras) and the heading/section pair is always resolvable.[ADD]
src/__tests__/KeyboardShortcutsModal.portal.test.tsxdocument.body, while the trigger button stays in place.Generalsorts last.aria-labelledbyresolves to a real, whitespace-free id and that multi-word categories slugify correctly.Verification Results
document.body; no longer clipped by the header's containing blockShortcutRegistryuseShortcutRegistry(); category order now stable (Navigation, Invoices, Payments, …, General)onClosewiring for backdrop, close button andFocusTrapEscapescreen-based tests unaffected; new tests added insrc/__tests__/KeyboardShortcutsModal.portal.test.tsx