Skip to content

fix: cap only popups that size to the space left, and keep the rule overridable - #52

Merged
pronob1010 merged 1 commit into
mainfrom
fix/embedded-popup-cap-scope
Oct 6, 2026
Merged

pronob1010 merged 1 commit into
mainfrom
fix/embedded-popup-cap-scope

Conversation

@pronob1010

Copy link
Copy Markdown
Collaborator

Follow-up to #50, which was merged (and released in 0.3.0) before its review fixes landed.

#50's rule, html[data-embedded] [data-radix-popper-content-wrapper] > * { max-height: 24rem }, has three problems:

  1. Plain Popover content gets a cap it never had, with no scrollbar. PopoverContent sets no max-height or overflow, so a 600px filter popover inside the dashboard is cut to 384px and its content spills or squashes. Standalone it shows whole.
  2. It can't be overridden. It's unlayered, so it beats every Tailwind utility: an app's <PopoverContent className="max-h-[32rem]"> is silently ignored inside the dashboard.
  3. Tooltips and hover cards match too.

Fix:

  • The rule now targets only content that caps itself at the Radix available height: [data-radix-popper-content-wrapper] > [class*="available-height"]. That's the date pickers, DropdownMenu, ContextMenu, popper-mode Select, RichSelect and TreeSelect, which all already scroll. Plain popovers, tooltips and hover cards are untouched. A plain popover shows whole, and fix(app-bridge): grow the frame while a popup reaches past the page flycommerce-sdk#9 grows the frame to fit it.
  • It sits in @layer utilities, next to the max-h-(…) utilities it overrides, where its higher specificity wins and an app's !max-h-* can still beat it. Not @layer components: Tailwind's utilities layer comes later and would beat the rule whatever its specificity, so the cap would never apply.

Checked:

  • In the order-export example inside the example dashboard, with sdk#9, the date picker shows whole, both near the top of the page and low on a short page.
  • pnpm run build:css passes, and the built styles.css has the rule inside the utilities layer.

The changelog entry is under Unreleased; 0.3.0's entry is unchanged.

…verridable

0.3.0's embedded cap matched every popup: plain Popover content got cut
at 24rem with no scrollbar, and tooltips matched too. It now targets
content that caps itself at the available height, in the utilities
layer so apps can override it.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying flycommerce-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9824815
Status: ✅  Deploy successful!
Preview URL: https://76f03475.flycommerce-ui.pages.dev
Branch Preview URL: https://fix-embedded-popup-cap-scope.flycommerce-ui.pages.dev

View logs

@pronob1010
pronob1010 merged commit e7ec535 into main Oct 6, 2026
3 checks passed
@pronob1010
pronob1010 deleted the fix/embedded-popup-cap-scope branch October 6, 2026 06:40
@pronob1010 pronob1010 mentioned this pull request Oct 6, 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