Skip to content

fix(Dropdown): remove default listbox role from overlay wrapper - #1188

Merged
vrajput-eightfold merged 3 commits into
EightfoldAI:mainfrom
vrajput-eightfold:fix/dropdown-remove-default-listbox-role
Nov 26, 2026
Merged

vrajput-eightfold merged 3 commits into
EightfoldAI:mainfrom
vrajput-eightfold:fix/dropdown-remove-default-listbox-role

Conversation

@vrajput-eightfold

@vrajput-eightfold vrajput-eightfold commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

SUMMARY:

Dropdown gave its overlay wrapper role="listbox" by default. Most overlays render their own semantic container, such as a role="menu" Menu or a filter form, so screen readers heard a menu inside a listbox, or a listbox around controls that aren't options.

The wrapper now has no role by default, so the overlay content supplies its own. To set one, pass role or overlayProps.role.

Impact

  • PersistentBar, Pagination, SkillBlock, SkillTag, Breadcrumb, LiveTaskBar, and the Table filter and selection dropdowns don't set a role. They now announce only their overlay content's role (role="menu" for the Menu-based ones).
  • Tabs (role="menu") and Select (role={null}) set their own role, so they're unchanged.
  • A consumer that puts role="option" items directly in the overlay, with no listbox of its own, must now pass role="listbox".

GITHUB ISSUE (Open Source Contributors)

N/A

JIRA TASK (Eightfold Employees Only):

https://eightfoldai.atlassian.net/browse/ENG-215005
https://eightfoldai.atlassian.net/browse/ENG-214951
https://eightfoldai.atlassian.net/browse/ENG-215016
https://eightfoldai.atlassian.net/browse/ENG-214939

CHANGE TYPE:

  • Bugfix Pull Request
  • Feature Pull Request

TEST COVERAGE:

  • Tests for this change already exist
  • I have added unittests for this change

TEST PLAN:

  • yarn test: all 231 suites pass. 3 Menu snapshots were updated, and the only change in each is the removed role="listbox" line.
  • yarn typecheck passes.
  • To verify manually: open a Dropdown with a Menu overlay in Storybook and confirm the overlay wrapper has no role attribute.

I have added screenshots for 1 such case:

Before this change:

Screenshot 2026-11-23 at 3 43 35 PM

After this change:

Verify that their is no role = listbox, wrapping a menu:

Screenshot 2026-11-23 at 3 40 07 PM

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vrajput-eightfold
vrajput-eightfold force-pushed the fix/dropdown-remove-default-listbox-role branch from 77aa188 to 56a9928 Compare November 23, 2026 09:22

@agupta-eightfold agupta-eightfold left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropdown.stories.tsx:515 still wraps the role="list" overlay in overlayProps.role: 'listbox', so that story keeps the pattern this PR removes. Can we drop it there too?

Comment thread src/components/Dropdown/Dropdown.tsx Resolved
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vrajput-eightfold

Copy link
Copy Markdown
Contributor Author

Re the Dropdown.stories.tsx note: 1e72da6 removes the overlayProps block from the shared dropdownArgs, so the role="list" overlay is no longer wrapped in a listbox. I dropped the aria-label too, since a label on a div with no role has no effect.

@vrajput-eightfold
vrajput-eightfold merged commit c9b1b23 into EightfoldAI:main Nov 26, 2026
2 of 3 checks passed
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.

3 participants