Repository navigation
fix(web): keep inactive hidden text and password proxies inert - #1473
Merged
Merged
Conversation
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.
Fixes #594
Root cause
mount()incrates/rune/src/platform/web/bridge.jsappended both the hidden<textarea>(Text input) and<input type="password">(Password input) proxies todocument.bodywith onlyopacity:0,pointer-events:none, andtabIndex = -1, leaving both permanently exposed in the browser accessibility tree.sync()never marked inactive proxiesinert, so both remained exposed when no Rune text field was focused and the inactive proxy stayed exposed while the other was in use.Changes
crates/rune/src/platform/web/bridge.js:field.inert = trueon both proxies inmount().!keyinsync(), return DOM focus toh.canvasfirst if an editing proxy was focused, then seth.textarea.inert = trueandh.password.inert = true.keyinsync(), clearh.field.inert = falsebefore focusing or callingactivate(h), then mark the inactive proxyinert = trueafter focus has moved.crates/rune/src/platform/web/bridge.test.mjs:FakeNodeHTMLinertsemantics (inert elements refusefocus(), and settinginert = trueon the focused element drops focus todocument.body).inerton blur.changelog/unreleased/2026-11-23-web-hidden-input-inert.md: add changelog entry.Verification
node --test crates/rune/src/platform/web/bridge.test.mjs(failed before the fix; 10/10 passed after)cargo check -p rune --no-default-features --target wasm32-unknown-unknown(passed)scripts/file-size.sh(0 errors)