Skip to content

Web accessibility mirror omits closable TabStrip tabs and the tablist container #1344

Closed

Description

@pascalandr

Reproduced at 21e5342b9a4cc33eeee88071b4b1f0eafb1247d4, Windows, Rust 1.99.1, using Runtime without a window. A product WASM build reproduces the same missing controls.

With two closable rune-kit tabs, native elements include both tabs, but Runtime::a11y_json() contains only the close buttons. Tab names and aria-selected disappear from the browser mirror. Removing closes restores the tab controls, while the tablist container remains absent.

Standalone example (compiled and run in both modes):

use rune::{Cx, El, Env, Runtime};
use rune_kit::{Kit, shell::{TabItem, TabOrientation, TabStrip}};

struct State { active: String, plain: bool, closed: usize }
fn view(s: &State, _: &mut Cx<State>) -> El {
    TabStrip::new("tabs", TabOrientation::Horizontal)
        .tabs([TabItem::new("a", "Alpha").closable(!s.plain),
               TabItem::new("b", "Beta").closable(!s.plain)])
        .active(Some(&s.active)).close_tab_stop(true).hover_none(true)
        .on_select(|s: &mut State, id, _| s.active = id.into())
        .on_close(|s: &mut State, _, _| s.closed += 1)
        .build(&Kit::neutral(false))
}
fn main() {
    let plain = std::env::args().any(|arg| arg == "--plain");
    let mut rt = Runtime::new(
        State { active: "a".into(), plain, closed: 0 },
        view, (800.0, 120.0), Env::new(false, 1.0));
    rt.frame(0.0);
    for _ in 0..30 { rt.frame(1.0 / 60.0); }
    let native = rt.elements();
    assert_eq!(native.iter().filter(|e| e.role == "tab").count(), 2);
    assert_eq!(native.iter().filter(|e| e.role == "tablist").count(), 1);
    let items: Vec<serde_json::Value> =
        serde_json::from_str(&rt.a11y_json()).unwrap();
    if !plain {
        assert_eq!(items.iter().filter(|e| e["o"] == "tab").count(), 2);
    } else {
        assert_eq!(items.iter().filter(|e| e["o"] == "tablist").count(), 1);
    }
}

Place in a rune-kit example and run normally, then with --plain. The final assertions fail with 0 instead of 2, then 0 instead of 1.

Source observations:

  • runtime/web/a11y.rs: button_like && !nested_press skips the parent tab when its close has a press handler.
  • a11y/roles.rs: tablist lacks a container/ARIA-container mapping.
  • shell/tab_strip/tab.rs: the final slot.role("tab") follows the public decorator, so wrapping sibling controls there also gives their wrapper a tab role.

Expected: named selectable tabs, selected state, independent close controls and their tablist grouping in the browser semantic representation. Related broader work: #118; #592 concerns exiting children.

Activity

  1. Hona commented on Nov 23, 2026

    @Hona
    Member

    The web mirror gave tablist no container, and it skipped any pressable control that held another button, so closable tabs were dropped. This is fixed on dev in #1583 (9c915fe): the mirror now writes the tablist, each tab with its selected state, and each close button beside its tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions