The dropdown, hint, tooltips and selected-items popover are all placed with Floating UI as position: fixed panels that normally anchor to the
viewport, right under the input.
Containing-block trap. A CSS containing block on any ancestor β
transform, perspective, filter, backdrop-filter, will-change, contain, or container-type β can capture fixed positioning and make the panel drift away from
the input. The component detects the likely culprits and warns in the console once per instance.There are two consumer-side fixes when you hit the warning:
- Replace
contain/container-typeon the intended anchor withtransform: translateZ(0)β the same containing-block effect, but browsers definitively honor it for fixed positioning. - Move the
<web-multiselect>out of the problematic subtree.
PO01 Baseline & size controls
No special ancestor CSS β the panel anchors to the viewport, under the input.
Controls
Lock the dropdown placement after the first open so it stops flipping as you scroll.
CSS length the list grows to before it scrolls.
Quick usage
lock-placement(defaulttrue) fixes the chosen side after the first open, so the panel does not flip above/below as you scroll or the page reflows.max-heightcaps how tall the list grows before it scrolls β a CSS length, defaulting to20rem.
Inside a transformed ancestor
The demo below is wrapped in a div with transform: translateZ(0).
PO02 Transformed wrapper
transform establishes a containing block β browsers honor it, so the panel still lands under the input.
transform establishes a containing block that browsers honor, so the panel still anchors correctly under the input β unlike contain / container-type.
Quick usage
Problematic: contain: paint
Fix: transform: translateZ(0)