Repository navigation
fix(overlay): keep comment-box keystrokes from reaching the host page - #15
Merged
Merged
Conversation
…t page Key events from the comment textarea bubbled out of the shadow root to document, retargeted to the host, so pages that listen there (Reveal.js is the case in hand) acted on them. The shadow host now stops key events that start in an editable element. Esc is consumed only when the overlay has something to dismiss, and ? only when it opens the queue. UX-12 and UX-13 in REQUIREMENTS, with unit and Playwright coverage. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Typing in the overlay's comment box triggers keyboard shortcuts on the host page. On a Reveal.js deck, typing v, n, f, space, or an arrow key in the textarea navigates or toggles the deck instead of just entering text.
Key events from the textarea bubble out of the shadow root to
document, where they are retargeted to the shadow host. A host page listening ondocumentsees a DIV asactiveElement, not a textarea, and acts on the key.Changes
keydown,keyup, andkeypresswhen the event started in an editable element (assets/overlay/ui/shadow.js).isEditableis now exported.?is consumed only when it opens the queue (assets/overlay/app.js).docs/REQUIREMENTS.md, and a CHANGELOG entry under Unreleased.Tests
test/unit/key-isolation.test.jsandtest/browser/key-isolation.spec.jsare new.npm test: 55 unit and 13 server tests pass, and the requirement coverage gate passes.npm run test:browser: 35 pass. With the overlay changes stashed, 3 of the 5 new browser tests fail.composedPath. The Playwright spec covers the real shadow behaviour.🤖 Generated with Claude Code
🤖 Claude on behalf of Sean