Skip to content

refactor: rename dropdownContentRole to ariaRole #4248

Open
mxschll wants to merge 3 commits intomainfrom
dev-v3-schomax-dropdown-aria
Open

refactor: rename dropdownContentRole to ariaRole #4248
mxschll wants to merge 3 commits intomainfrom
dev-v3-schomax-dropdown-aria

Conversation

@mxschll
Copy link
Member

@mxschll mxschll commented Feb 12, 2026

Description

  • This PR refactors the dropdownContentRole prop of the Dropdown component to be named ariaRole aligning its API with Flashbar
  • Introduces the ariaLabel prop

Related

[Quip proposal: RGJgABPXohP8]

How has this been tested?

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@codecov
Copy link

codecov bot commented Feb 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.35%. Comparing base (87a3e47) to head (c508b7f).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4248   +/-   ##
=======================================
  Coverage   97.35%   97.35%           
=======================================
  Files         888      889    +1     
  Lines       26031    26040    +9     
  Branches     9411     9417    +6     
=======================================
+ Hits        25343    25352    +9     
  Misses        641      641           
  Partials       47       47           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mxschll mxschll force-pushed the dev-v3-schomax-dropdown-aria branch from 4d77dbc to 6630f2d Compare February 17, 2026 19:58
ref={contentRef}
id={id}
role={role}
role={ariaRole}
Copy link
Member Author

Choose a reason for hiding this comment

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

That's on the div, so it stays role :)

<Dropdown trigger={<button />} open={false} ariaRole="dialog" content={<div>Content</div>} />
);
// Dropdown content exists in DOM even when closed (for transitions)
const dropdownContainer = wrapper.getElement().querySelector('[aria-hidden]');
Copy link
Member

Choose a reason for hiding this comment

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

I do not recommend to query aria-hidden and check for the same attribute. Can you query data-tesetid instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch, thanks. We don't have a data-testid on the dropdown content wrapper. I'll query for data-open so we don't have the same attribute.

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.

2 participants