Repository navigation
Copy inside modal dialogs and fullscreen elements - #2
Merged
Merged
Conversation
While a modal dialog or a fullscreen element is open, everything outside of it is inert, so the execCommand fallback's textarea appended to the body could not hold the selection and the copy silently copied nothing while still reporting success. Append it inside the focused element's modal element instead, falling back to the first one when focus is lost. Co-Authored-By: Claude (Opus 5.5) <noreply@anthropic.com>
Explains why the lookup needs two steps: the topmost modal element is not exposed by any API. Co-Authored-By: Claude (Opus 5.5) <noreply@anthropic.com>
The same-line comment made the line hard to read. Co-Authored-By: Claude (Opus 5.5) <noreply@anthropic.com>
silverwind
added a commit
that referenced
this pull request
Oct 18, 2026
* Copy inside modal dialogs and fullscreen elements (#2) (silverwind) * Disable pnpm's dlx cache (silverwind) * update deps (silverwind) * Consolidate tests (silverwind) * Fix stray colon in README options (silverwind) * Run all make targets in CI (silverwind) * Remove duplicate release job permissions (silverwind) * Align Makefile targets (silverwind) * Simplify tests and demo page (silverwind) * Fix stale README claims (silverwind) * Align Makefile targets (silverwind) * Update dependencies (silverwind) * Unify README usage section (silverwind) * Cancel superseded CI runs (silverwind)
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.
While a modal
<dialog>or a fullscreen element is open, everything outside of it is inert. TheexecCommandfallback appended its textarea todocument.body, so it could not hold the selection and the copy silently copied nothing while still returningtrue(falsein WebKit).The textarea is now appended inside the focused element's
:modalelement, falling back to the first:modalelement when focus is lost. Both lookups are needed because the top layer order is not exposed (whatwg/html#9075).Written by Claude.