fix(ui5-date-picker): use variable for popover width in compact density mode #12305
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The DatePicker popover was displaying unnecessary whitespace when the content density was set to "compact". This occurred because the popover width was hardcoded to
20rem
in the CSS, while the calendar content inside adapts to different widths based on the content density:20rem
(320px)17.75rem
(284px)This mismatch resulted in a 36px whitespace gap in compact mode, as shown in the issue screenshot.
Solution
The fix replaces the hardcoded width with a CSS variable that already exists in the design system and automatically adapts to content density:
The CSS variable
--_ui5_calendar_width
is defined in the base sizes parameters:--_ui5_calendar_width: 20rem
[data-ui5-compact-size]
selector):--_ui5_calendar_width: 17.75rem
This ensures the popover width automatically matches the calendar width in both content density modes, eliminating the whitespace issue while maintaining perfect alignment.
Fixes #12277.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
download.cypress.io
googlechromelabs.github.io
/usr/local/bin/node install.js
(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.