Skip to content

Fix for #13359: [Select]: Add default max-width #13545

Open
EdrilanBerisha wants to merge 5 commits into
UI5:mainfrom
EdrilanBerisha:main
Open

Fix for #13359: [Select]: Add default max-width #13545
EdrilanBerisha wants to merge 5 commits into
UI5:mainfrom
EdrilanBerisha:main

Conversation

@EdrilanBerisha
Copy link
Copy Markdown
Contributor

@EdrilanBerisha EdrilanBerisha commented May 19, 2026

Fixing #13359

To fix the missing max-width I used the same pattern already used in similar components like:

-ComboBox.ts (line 1728)
-Input.ts (line 1951)
-MultiComboBox.ts (line 2383)

All three follow the identical logic: "if the component is wider than 40rem, clamp the popover to the component's own width in px; otherwise default to 40rem."

If you wish to use a different max-width let me know I can adjust and also modify the tests

…opdown

Fixes issue UI5#13359 where ui5-select popover would expand to full page width
when an option has very long text content. This aligns the behavior with the
SAP Fiori ComboBox (sap.m.ComboBoxTextField) which applies a default max-width
of 100rem to its picker dropdown.

The fix applies max-width: 100rem as an inline style on the responsive popover
via the component's styles() getter, matching the ComboBox's getMaxWidth() API
default value.

Added two Cypress unit tests verifying:
- The max-width: 100rem style is applied when an option has very long text
- The max-width: 100rem style is always present as a default on the popover
…attern

Use the same max-width pattern as ComboBox and Input:
- If the component width in rem exceeds 40, cap max-width at the component's
  own pixel width (preventing the picker from growing wider than the control)
- Otherwise fall back to the 40rem default cap

This replaces the previous flat 100rem value and matches the established
pattern used in ComboBox.ts and Input.ts.

Updated Cypress tests to reflect the dynamic max-width logic:
- Narrow select (200px) -> expects max-width: 40rem
- Wide select (1000px) -> expects max-width in px matching the component width
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 19, 2026

CLA assistant check
All committers have signed the CLA.

@EdrilanBerisha EdrilanBerisha changed the title Related to {#13359} [Select]: Add max-width to Dropdown list Related to #13359: [Select]: Add max-width to Dropdown list May 19, 2026
@kgogov kgogov self-requested a review May 19, 2026 10:54
@EdrilanBerisha EdrilanBerisha changed the title Related to #13359: [Select]: Add max-width to Dropdown list Fix for #13359: [Select]: Add default max-width May 19, 2026
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.

1 participant