Skip to content

[Bug] DropdownMenu: a custom trigger named by aria-labelledby opens an unnamed menu #13651

Done

Description

@korkt-kim

Description

Actual: With renderTrigger, the trigger and its item have accessible names, but the popover's role="menu" has an empty computed name. Using aria-label on the same trigger instead names the menu correctly.

Expected: The trigger and the menu both have the computed name Project actions, as specified by DropdownMenu FR9 and AR1. This is an Astryx accessibility contract mismatch, not a WCAG violation claim.

Reproduction

Open reproduction in Astryx Playground

Open the ellipsis trigger with Enter and inspect the menu's computed name in DevTools Accessibility. The checkbox switches the trigger to aria-label.

Render Repro in the Astryx Storybook or a themed Astryx app.

import {useId} from 'react';
import {DropdownMenu} from '@astryxdesign/core/DropdownMenu';

export function Repro() {
  const labelId = useId();
  return (
    <>
      <span id={labelId}>Project actions</span>
      <DropdownMenu
        presentation="popover"
        renderTrigger={props => (
          <button {...props} type="button" aria-labelledby={labelId}>
            <span aria-hidden="true">⋯</span>
          </button>
        )}
        items={[{label: 'Archive'}]}
      />
    </>
  );
}
  1. Focus the ⋯ button and press Enter.
  2. In Chrome DevTools → Elements → Accessibility, check the computed Name of the button and of the menu. The button is named Project actions; the menu is unnamed.
  3. Replace the button's aria-labelledby={labelId} with aria-label="Project actions" and repeat. The menu's computed name is now Project actions.

Astryx Version

@astryxdesign/core@0.7.18 in a repository checkout at 5fed5e922b.

Environment

Playwright Chromium 149.0.7827.55 and WebKit 26.5, running the Astryx Storybook on macOS.

Activity

  1. cixzhang commented on Nov 23, 2026

    @cixzhang
    Contributor

    🤖 (Posted by Cindy's agent.) Thanks, @korkt-kim. Confirmed from main's source: with renderTrigger and no aria-label, the menu takes aria-labelledby pointing at the trigger's id. When the trigger is itself named through aria-labelledby, that name isn't followed a second level deep (accessible-name computation doesn't chain references), so an icon-only trigger leaves the menu unnamed. I've passed it to the maintainers.

  2. ravindrasinghshah commented on Nov 23, 2026

    @ravindrasinghshah
    Contributor

    Hi, I'd like to take this one. I'll make the menu pick up the trigger's aria-labelledby name so a custom trigger named that way names the menu too, and add a regression test.

  3. cixzhang commented on Nov 25, 2026

    @cixzhang
    Contributor

    🤖 (Posted by Cindy's agent.) Fixed by #13730, now merged, carrying @rheatkhs's fix: a DropdownMenu whose custom trigger is named with aria-labelledby now gives its menu the same accessible name. Thanks for the report, @korkt-kim!

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