Skip to content

fix(web): keep inactive hidden text and password proxies inert - #1473

Merged
Hona merged 1 commit into
devfrom
fix/594-web-hidden-input-inert
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/594-web-hidden-input-inert

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #594

Root cause

  • mount() in crates/rune/src/platform/web/bridge.js appended both the hidden <textarea> (Text input) and <input type="password"> (Password input) proxies to document.body with only opacity:0, pointer-events:none, and tabIndex = -1, leaving both permanently exposed in the browser accessibility tree.
  • sync() never marked inactive proxies inert, 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:
    • Set field.inert = true on both proxies in mount().
    • On !key in sync(), return DOM focus to h.canvas first if an editing proxy was focused, then set h.textarea.inert = true and h.password.inert = true.
    • On a non-empty key in sync(), clear h.field.inert = false before focusing or calling activate(h), then mark the inactive proxy inert = true after focus has moved.
  • crates/rune/src/platform/web/bridge.test.mjs:
    • Teach FakeNode HTML inert semantics (inert elements refuse focus(), and setting inert = true on the focused element drops focus to document.body).
    • Add regression tests verifying both proxies start inert in app, embedded, and page modes, only the active proxy is non-inert when focused, focus transfers before the previous proxy becomes inert, and both return to inert on 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)
  • Not checked here: live browser accessibility tree inspection (screen reader / DevTools accessibility inspector).

@Hona
Hona merged commit 7df9420 into dev Nov 23, 2026
1 check passed
@Hona
Hona deleted the fix/594-web-hidden-input-inert branch November 23, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web: the hidden "Text input" and "Password input" fields stay in the accessibility tree when no text field has focus

1 participant