Skip to content

Conversation

@heloiselui
Copy link
Contributor

@heloiselui heloiselui commented Nov 3, 2025

Closes #18332

Update <cds-dropdown> Web Component to match React component parity.

Changelog

New

  • Added keyboard navigation support (ArrowUp, ArrowDown, Enter, Space)
  • Added hover and focus highlight handling on dropdown items
  • Added new Storybook stories and controls aligned with React

Changed

  • Refactored internal dropdown logic to match React behavior for open/close, selection, and keyboard interactions
  • Updated event handling for consistency (cds-dropdown-beingselected, cds-dropdown-beingtoggled, etc.)
  • Updated CSS and token usage for parity with React (spacing, borders, hover and focus outlines)
  • Updated Storybook to use args and argTypes
  • Refactored rendering of dropdown menu and trigger to match React implementation
  • Fixed invalid icon is on the wrong side when using AI-Label
  • Fixed tests in dropdown and multi-select

Removed

  • Removed outdated SCSS rules related to list-box outlines and helper text placement

Testing / Reviewing

  1. Go to WC Deploy Preview > Dropdowncompare with the React Dropdown.
  2. Verify all controls and props (disabled, invalid, warn, readOnly, size, type...) behave consistently. (I open a separate issue to implement the autoAlign prop).
  3. Test keyboard interactions:
    • Enter and Space open/close and select items
    • ArrowUp and ArrowDown navigate between items
  4. Check that focus and hover visuals align with React behavior.
  5. Review the following Storybook stories for accuracy:

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • [ ] Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 47bfb32
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69176c28c544ee000884a093
😎 Deploy Preview https://deploy-preview-20863--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 47bfb32
🔍 Latest deploy log https://app.netlify.com/projects/carbon-elements/deploys/69176c28dc880d0008fee52f
😎 Deploy Preview https://deploy-preview-20863--carbon-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 3, 2025

Deploy Preview for v11-carbon-react ready!

Name Link
🔨 Latest commit 47bfb32
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69176c28dc880d0008fee52d
😎 Deploy Preview https://deploy-preview-20863--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.57%. Comparing base (4624664) to head (47bfb32).
⚠️ Report is 1 commits behind head on main.

❗ There is a different number of reports uploaded between BASE (4624664) and HEAD (47bfb32). Click for more details.

HEAD has 3 uploads less than BASE
Flag BASE (4624664) HEAD (47bfb32)
web-components 2 0
main-packages 2 1
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #20863      +/-   ##
==========================================
- Coverage   92.39%   85.57%   -6.82%     
==========================================
  Files         515      357     -158     
  Lines       37629    14501   -23128     
  Branches     5740     4903     -837     
==========================================
- Hits        34766    12409   -22357     
+ Misses       2714     1952     -762     
+ Partials      149      140       -9     
Flag Coverage Δ
main-packages 85.57% <ø> (ø)
web-components ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@heloiselui heloiselui marked this pull request as ready for review November 4, 2025 13:07
@heloiselui heloiselui requested a review from a team as a code owner November 4, 2025 13:07
Copy link

@sunny-babbar sunny-babbar left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

Nice work! Just a few comments:

  • The warn icon overlaps when the text is long
Screenshot 2025-11-06 at 11 23 14 AM

the invalid icon works fine, though

  • When toggling disabled on then turning it off, the items remain disabled
Screenshot 2025-11-06 at 11 36 27 AM
  • Some changes are bleeding into the multi-select component causing regressions (can't type in filterable input, list closes after selection, styles, hovering over items, etc.)
Screen.Recording.2025-11-06.at.11.31.25.AM.mov
  • The combobox component is also inheriting some of the focus management from dropdown, too

@heloiselui heloiselui marked this pull request as draft November 10, 2025 17:11
@heloiselui heloiselui self-assigned this Nov 10, 2025
Copy link
Contributor

@maradwan26 maradwan26 left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@heloiselui heloiselui enabled auto-merge November 14, 2025 17:56
@heloiselui heloiselui added this pull request to the merge queue Nov 14, 2025
Merged via the queue into carbon-design-system:main with commit 18b87e5 Nov 14, 2025
40 of 43 checks passed
@heloiselui heloiselui deleted the 18332-parity-wc-dropdown branch November 14, 2025 18:46
@github-project-automation github-project-automation bot moved this from 🚦 In Review to ✅ Done in Design System Nov 14, 2025
github-merge-queue bot pushed a commit that referenced this pull request Nov 20, 2025
…21048)

* feat(dropdown): reintroduce parity changes from reverted PR #20863

* fix(multi-select): ensure input reflects aria-expanded state
grishma-shah7 pushed a commit to grishma-shah7/carbon that referenced this pull request Nov 24, 2025
…sign-system#20863 (carbon-design-system#21048)

* feat(dropdown): reintroduce parity changes from reverted PR carbon-design-system#20863

* fix(multi-select): ensure input reflects aria-expanded state
github-merge-queue bot pushed a commit that referenced this pull request Nov 24, 2025
* fix: added missing accessibility labels for pagination elements

* fix: update contribution

* Fix formatting for cds-callout-notification section (#21036)

Co-authored-by: Gururaj J <[email protected]>
Co-authored-by: Heloise Lui <[email protected]>

* feat(dropdown): reintroduce parity changes from reverted PR #20863 (#21048)

* feat(dropdown): reintroduce parity changes from reverted PR #20863

* fix(multi-select): ensure input reflects aria-expanded state

* fix: address review comment

* chore(styles): update Sass API for web component builds (#21044)

* chore(styles): update sass api for web component builds

* chore(styles): update deprecated type-of() in theme

---------

Co-authored-by: Gururaj J <[email protected]>
Co-authored-by: Heloise Lui <[email protected]>

* fix(combobox): sync menu highlight with controlled selection (#21064)

---------

Co-authored-by: Maximilian Smidt <[email protected]>
Co-authored-by: Gururaj J <[email protected]>
Co-authored-by: Heloise Lui <[email protected]>
Co-authored-by: kennylam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

React|WC Parity: Dropdown

4 participants