When anchored floating content is placed on a preferred side that does not have enough room, the current behavior appears to keep that side and clamp the final position into the viewport.
This can cause the floating content to overlap the anchor instead of appearing on the opposite side.
Example:
- preferred side is
Start
- the anchor is already close to the left edge
- instead of placing the content on
End, the content is clamped into the window and ends up covering the anchor
This is especially noticeable for tooltips, menus, and other anchored surfaces where overlap looks incorrect.
A better default would be:
- compute the preferred placement
- if it does not fit on the requested side, try the opposite side
- if multiple candidates are possible, choose the one with the least overflow
- only clamp as a last resort after selecting the best side
It would also be useful if this behavior were configurable, for example:
- keep current clamp-only behavior
- allow automatic fallback to opposite side
- optionally provide a list of fallback sides
That would make anchored positioning behave more like expected floating UI placement near viewport edges.
When anchored floating content is placed on a preferred side that does not have enough room, the current behavior appears to keep that side and clamp the final position into the viewport.
This can cause the floating content to overlap the anchor instead of appearing on the opposite side.
Example:
StartEnd, the content is clamped into the window and ends up covering the anchorThis is especially noticeable for tooltips, menus, and other anchored surfaces where overlap looks incorrect.
A better default would be:
It would also be useful if this behavior were configurable, for example:
That would make anchored positioning behave more like expected floating UI placement near viewport edges.