fix(core): FloatingPopover escapes a transformed ancestor's containing block; native Select mode - #518
Conversation
@vitejs/devtools
@vitejs/devtools-kit
@vitejs/devtools-oxc
@vitejs/devtools-rolldown
@vitejs/devtools-vite
@vitejs/devtools-vitest
commit: |
…ect mode - `FloatingPopover` teleports its panel out of the outermost ancestor that forms a containing block for `position: fixed`, so the panel is neither positioned relative to it nor clipped by its `overflow`. With no such ancestor it renders in place, unchanged. The target stays inside the shadow root, which is where the panel's styling comes from. - New `surface` prop on `FloatingPopover`: `menu` drops the tooltip padding and uses `bg-glass:25` with a slightly stronger border, for a panel that stacks over an already-tinted surface where tooltip glass composites to near-black. - `Select` gains `native`, rendering a real `<select>` whose option list the browser draws outside the page's layout. Trades away `icon`, `description` and `searchable`. - `Select`'s dropdown adopts the `menu` surface, `gap: 4`, `primary` for the selected option and `surfaceBadge` for the active row.
59b5a4c to
e6153ad
Compare
|
Thanks for this fix! As of #529, the client UI previously at Since this PR's changes target code that no longer lives here, we're labeling it |
|
I think we can close this, it has been ported to devframe already ? |
What changed
FloatingPopoverresolves the outermost ancestor that forms a containing block forposition: fixeddescendants and<Teleport>s its panel into that ancestor's parent. With no such ancestor, it renders in place as before.surfaceprop onFloatingPopover,tooltip(default) ormenu.menurendersp0 bg-glass:25 border-#8883in place ofpx2 p1 bg-glass:80 border-base.Selectgainsnative, rendering a real<select>instead of the custom listbox. It has noicon,descriptionorsearchablesupport.Select's dropdown now usessurface="menu"andgap: 4, colours the selected option withprimaryand the active row withsurfaceBadge, and no longer passes!p0inpanelClass.webcomponentsAPI snapshot updated forSelectProps.native.Why it changed
A
position: fixedpanel is positioned relative to its nearest ancestor carrying a non-nonetransformorfilter, not the viewport, and is clipped by that ancestor'soverflow. Rendered inside such a panel, theSelectdropdown was offset from its trigger and cut off — unusable. Escaping the outermost rather than the nearest such ancestor matters because escaping one can land inside another. The teleport target stays inside the shadow root, since that is where the panel's stylesheet is adopted anddocument.bodywould strip its styling.The
menusurface exists because a floating panel stacks over an already-tinted surface, where tooltip-strength glass composites to near-black, and because tooltip padding is wrong for a listbox — it inset the options and made the panel wider than its trigger.nativeis an escape hatch worth having regardless of the fix above: the browser draws a native option list outside the page's layout, so no ancestor can clip or misposition it at all, which is the dependable choice for aSelectembedded in a host layout this component doesn't control. Its option list needs no styling here, asColorSchemeRootalready setscolor-schemeinline and that inherits.