Skip to content

fix(web): export a11y_value and combobox role in the web accessibility mirror and focus proxy - #1752

Merged
Hona merged 1 commit into
devfrom
fix/1676-web-a11y-select-value
Nov 23, 2026
Merged

Hona merged 1 commit into
devfrom
fix/1676-web-a11y-select-value

Conversation

@Hona

@Hona Hona commented Nov 23, 2026

Copy link
Copy Markdown
Member

Fixes #1676

Root cause

  • rune_kit::Select (crates/rune-kit/src/overlays/select.rs) sets role("combobox"), label(name), expanded(open), and a11y_value(current) while hiding its visible value text with a11y_hidden().
  • RuntimeCore::web_focus_item and RuntimeCore::web_a11y_items in crates/rune/src/runtime/web/a11y.rs dropped El::a11y_value, and combobox lacked a web_control_role in crates/rune/src/a11y/roles.rs.
  • focusA11y and syncA11y in crates/rune/src/platform/web/bridge.js never projected a control's value onto the focus proxy or mirrored combobox element.

Changes

  • crates/rune/src/a11y/roles.rs: mark combobox as a web_control role so mirrored combobox triggers keep role="combobox".
  • crates/rune/src/runtime/web/a11y.rs:
    • Add mirror_value to read El::a11y_value while omitting empty values and secure nodes (or descendants of secure containers).
    • Emit "v" from web_focus_item and A11yItem::to_json, and mirror role="combobox" triggers in web_a11y_items even without an on_press handler.
  • crates/rune/src/platform/web/bridge.js:
    • In focusA11y, clear el.textContent = '' on every focus turn and project f.v to aria-valuetext for range roles (slider, spinbutton, progressbar, meter, scrollbar) or el.textContent for combobox and other roles alongside aria-label (matching Chromium's select-only combobox exposure).
    • In syncA11y, mirror combobox items with aria-label for the accessible name and textContent for item.v.
  • crates/rune/src/runtime/web/a11y_tests.rs, crates/rune-kit/tests/a11y/overlays.rs, crates/rune/src/platform/web/bridge.test.mjs: regression tests covering web_a11y_focus, web_a11y, rune_kit::Select, secure omission, focusA11y, and syncA11y.

Verification

  • cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid runtime::web::a11y (20 passed)
  • cargo test -p rune -p rune-mermaid -p rune-kit --features rune-kit/markdown,rune-kit/mermaid a11y::roles (6 passed)
  • cargo test -p rune-kit --features rune-kit/markdown,rune-kit/mermaid --test a11y overlays (7 passed)
  • node --test crates/rune/src/platform/web/bridge.test.mjs (28 passed)
  • cargo check-wasm and cargo check-webgl (both passed)
  • scripts/file-size.sh (0 errors)
  • Not verified on this machine: live browser / screen-reader session (tested against the web mirror JSON and bridge DOM harness instead).

@Hona
Hona merged commit 8a9e2d9 into dev Nov 23, 2026
1 check passed
@Hona
Hona deleted the fix/1676-web-a11y-select-value branch November 23, 2026 23:45
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 accessibility bridge drops the selected value of a Kit Select

1 participant