Repository navigation
fix(email-blocks): keep the contact filter popovers on screen - #192
Merged
Merged
Conversation
Cap PopoverContent to the height Radix reports is left on screen and scroll the overflow, so long lists such as the contact filter menu no longer run off the edge.
…primitive PopoverContent is stock shadcn and, like upstream, leaves height to the content. Restore it and cap the contact filter builder's segment and filter popovers at the call site instead, so a future shadcn add can't overwrite the fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
The contact filter builder's popovers have no height limit. When one is taller than the space left in the viewport, part of it is pushed off screen. With eight filter types, the filter menu's "Add filter" heading and top items run past the top of the window when it opens upwards.
Fix
The segment and filter popovers in
contact-filter-builder.tsxare capped to--radix-popover-content-available-height, the space Radix reports is left on screen, and scroll whatever doesn't fit.The shadcn
PopoverContentprimitive stays stock. Like upstream shadcn, it leaves height to its content: shadcn caps menu components such asDropdownMenuandSelect, not the general-purpose popover. Fixing it at the call site means a futureshadcn addcan't overwrite it. The class uses the bracket formmax-h-[var(...)], which works with both the package's Tailwind 3 setup and consumers' Tailwind 4 scanning.A patch changeset for
@sendlit/email-blocksis included.Checks
email-blocks: typecheck, Biome and tests (10/10) pass.