Skip to content

fix(web-components): fluent-dropdown control overflows when white-space: nowrap is inherited#36218

Draft
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-fluent-dropdown-text-wrapping
Draft

fix(web-components): fluent-dropdown control overflows when white-space: nowrap is inherited#36218
Copilot wants to merge 2 commits into
masterfrom
copilot/fix-fluent-dropdown-text-wrapping

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

In multiselect mode, a long display value combined with an inherited white-space: nowrap from the host environment causes the slotted <button> to expand beyond the control's bounds, pushing the chevron indicator out of view.

Root cause: ::slotted(:is(input, button)) used all: unset (which resets white-space to inherit) plus flex: 1 1 auto with no min-width constraint — so the button could never shrink below its content width in the flex container.

Changes

  • dropdown.styles.ts — Added to ::slotted(:is(input, button)):
    • min-width: 0 — lets the flex item shrink below intrinsic content size
    • overflow: hidden + text-overflow: ellipsis — clips and truncates overflowing display value
    • white-space: nowrap — explicit override so the value never wraps regardless of inheritance
::slotted(:is(input, button)) {
  all: unset;
  flex: 1 1 auto;
  min-width: 0;           /* allow shrinking in flex context */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;    /* prevent inheritance of nowrap from breaking layout */
}
  • dropdown.stories.ts — Added MultipleSelectionOverflow story: multiselect dropdown with several pre-selected options rendered inside a white-space: nowrap; width: 300px container, directly reproducing the reported scenario.

Copilot AI changed the title [WIP] Fix fluent-dropdown text wrapping issue under white-space: nowrap fix(web-components): fluent-dropdown control overflows when white-space: nowrap is inherited May 18, 2026
Copilot AI requested a review from Hotell May 18, 2026 13:38
Copilot finished work on behalf of Hotell May 18, 2026 13:38
Comment on lines +108 to +111
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This was fixed with a one-line change in #36210

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: fluent-dropdown text wrapping breaks under white-space: no-wrap.

3 participants