Skip to content

[Bug] ComplexSelector: the default trigger is named by its label while it shows the value (Label in Name, WCAG 2.5.3) #7965

Open

Description

@DevThomson

Description

The default trigger of ComplexSelector is a <button aria-haspopup="dialog" aria-labelledby={labelId}> whose content is triggerLabel, the value chosen.

  • Its accessible name is the field label alone, so the value it shows isn't part of its name. axe-core 4.14 reports label-content-name-mismatch (Label in Name, WCAG 2.5.3). 4.14 moved that rule from experimental to a regular wcag21a rule, so it now fails any run with the WCAG 2.1 tags.
  • Because aria-labelledby overrides the content, the value isn't exposed at all: Chromium's accessibility tree shows button "Supplier", without "Acme Ltd".

Expected: as with Selector, whose trigger has role="combobox", the label names the control and the text it shows is its value. Giving the default trigger role="combobox" would do that. It already has aria-expanded, aria-controls and aria-haspopup="dialog", which ARIA 1.2 allows on a combobox.

Workaround: passing role="combobox" to ComplexSelector works today, because ...rest is spread onto the trigger before Astryx's own attributes.

Related: #6991 (the trigger's required and disabled semantics).

Reproduction

<ComplexSelector label="Supplier" value="1" onChange={() => {}} triggerLabel="Acme Ltd">
  {() => <p>Choose a supplier</p>}
</ComplexSelector>
  1. Render the above.
  2. Run axe-core 4.14 with the WCAG 2.1 tags, e.g. new AxeBuilder({ page }).withTags(['wcag21a']).analyze().
  3. label-content-name-mismatch is reported on the trigger button: "Text inside the element is not included in the accessible name".
  4. The accessibility tree shows button "Supplier"; "Acme Ltd" isn't exposed.

Astryx Version

@astryxdesign/[email protected]

Environment

Chromium and Firefox bundled with Playwright 1.64.1, Windows 11; axe-core 4.14.0 (@axe-core/playwright 4.14.0)

Activity

  1. added
    bug
    on Oct 23, 2026
  2. akhil9tiet commented on Oct 23, 2026

    @akhil9tiet

    I'd like to work on this — please assign it to me.

  3. parinith-web commented on Oct 26, 2026

    @parinith-web
    Contributor

    Thanks for the report. I checked this against current main (commit 4adaeda): the default trigger is already role="combobox" (added in the "ComplexSelector: the trigger is now a combobox whose popup is a dialog" change), so the label names the control and the shown value is its content, as with Selector. A combobox isn't named from its content, so axe's label-content-name-mismatch shouldn't apply to it. I haven't re-run axe 4.14 in a browser myself.

    I opened , which adds regression tests for this (the trigger is a combobox named by the label, with the chosen value or placeholder as its content). With role="combobox" removed, the tests fail and show the original button "Supplier" with the value hidden.

    @DevThomson, could you check whether you still see the failure on a build that includes the combobox change? You reported it on 0.7.3, and main is at 0.7.5. If not, this issue can probably be closed.

  4. DevThomson commented on Oct 26, 2026

    @DevThomson
    Author

    @parinith-web It's fixed on 0.7.5

    You can close this issue

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions