-
Notifications
You must be signed in to change notification settings - Fork 2.1k
fix(dropdown): add autoalign behavior #21185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
fix(dropdown): add autoalign behavior #21185
Conversation
✅ Deploy Preview for v11-carbon-react ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #21185 +/- ##
==========================================
- Coverage 85.12% 85.05% -0.07%
==========================================
Files 532 532
Lines 41136 41223 +87
Branches 6379 6395 +16
==========================================
+ Hits 35015 35061 +46
- Misses 5958 5997 +39
- Partials 163 165 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM . thanks @heloiselui
Just one observation
Downdown is opening on left/right as well - I think for dropdown it should open at top or bottom, I see same behaviour in react as well

Screen.Recording.2025-12-18.at.19.35.57.mov
I think this is related to the FloatingUIController, since we see the same behavior in the Menu button as well. I’ll open an issue for this: https://web-components.carbondesignsystem.com/?path=/story/components-menu-button--experimental-auto-align |
2nikhiltom
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not want to block the merge for this , The Downdown opening on left/right as well can be fixed as a separate PR. @heloiselui surfaced this same issue with menu-button
@2nikhiltom Thanks, just open an issue for this #21207 |
sunny-babbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be working, LGTM.
|
@heloiselui Just one comment in react it appears to shift to the right / off centered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me! just awaiting visual review confirmation


Closes #20859
This PR add autoalign behavior in web components Dropdown
Changelog
New
autoalignattribute to all stories.Changed
cds-dropdownso the menu can auto-align to the trigger.cds-popoverandcds-toggletipimport FloatingUIContollertoimport FloatingUIControllerRemoved
NoneTesting / Reviewing
WC Deploy Preview>Dropdown>Experimental Auto Alignautoalignto all story example is in the controls section.PR Checklist
As the author of this PR, before marking ready for review, confirm you:
[ ] Wrote passing tests that cover this change[ ] Addressed any impact on accessibility (a11y)More details can be found in the pull request guide