Repository navigation
Conversation
…x (CUI-323) A numeric collisionPadding pads all four sides, so menus moved up to 100px away from a trigger near a side edge, and lost 100px of available height at the top and bottom before they scrolled or flipped. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: c5eaf9a The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Storybook Preview Deployed✅ Preview URL: https://click-84v30s69o-clickhouse.vercel.app Built from commit: |
Chromatic Storybook
Built from commit: Statuses as of the end of the run. The build link shows the live review state. |
|
Hey @danielclickh |
DreaminDani
left a comment
There was a problem hiding this comment.
Seems fine to me but happy to make this 16px if 8px feels too tight. Let's wait for @danielclickh to respond
Description
Dropdown.ContentpassescollisionPadding={8}to Radix instead of100whenresponsivePositioningis on (the default). Menus now keep 8px from every viewport edge.--radix-dropdown-menu-content-available-height, which is the menu'smax-height, so menus scrolled or flipped 100px before they reached the top or bottom edge.responsivePositioning={false}is unchanged: no padding, no collision avoidance.Dropdown.Content, so they change too.SplitButton,DateRangePickerandDateTimeRangePickerrenderDropdown.Contentand get the same margin.Links and tickets
CUI-323. History: #535 (for #533) shortened the menu with
max-height: calc(... - 100px); #571 replaced that withcollisionPadding={100}, because, per #571, changing the size in CSS broke Popper's position calculations. The CSS version affected only the height; the prop also pads the left and right sides. Related: #1259 changes nearby lines inDropdown.tsx; the PR merged second needs a small conflict resolution.Good to know
Dropdown.tsx, because Radix takes a number, not a CSS token.Dropdownsets a collision padding.Popover,Select,TooltipandDatePickeruse Radix's default of 0. Aligning them is a separate follow-up.Tests
No unit test. The effect is layout. jsdom has a 0×0 viewport, so Radix computes an available height of −2 × padding (−16px now, −200px before). A test on that number would fail on this change, but the number has no meaning in a browser.
Visual specs run, all pass with no snapshot change:
Dropdown(27),SplitButton(15),daterangepicker(8),datetimerangepicker(10). None of them places a menu near a viewport edge, so they show that nothing else moved, not the new margin.Checklist
Contribution
buildandbuild-storybookwork locallyAccessibility
Skipped: no markup, behavior or ARIA changed. Only the menu's position and maximum height change.
Screenshots
TODO: before/after of a menu near the left edge, and of a long menu in a short window.
🤖 Generated with Claude Code