Skip to content

v0.15.1

Choose a tag to compare

@daopk daopk released this 04 Oct 15:51
· 24 commits to main since this release

Two positioning fixes, both for overlays rendered into a container other than the viewport. The one to read is the first: with <PortalProvider :container :root> anywhere but the top left of the page, tooltips and popovers now land where they should. Nothing changes for overlays placed against the viewport, the default.

Fixed

  • An overlay inside a PortalProvider root away from the page origin is placed right. The boundary was measured in page coordinates and the trigger and overlay in the container's, so the two agreed only while the container sat at the page origin. In a window elsewhere on the page, a tooltip flipped under its trigger because the room above came out negative, a popover by the bottom of the root never flipped, and one by its right edge was shifted by the window's offset instead of kept inside. The boundary, the trigger and the overlay are now all measured from the container's visible origin.
  • An overlay above or before its trigger keeps its distance in a bordered or body container. An overlay placed with bottom or right is measured from the far edge of its container's padding box. A bordered container was sized by its border box, so a tooltip above its trigger sat farther away by both borders. A positioned body was sized as the viewport, so with a body taller than the viewport the overlay landed about a thousand pixels off. And a body with contain: layout, content or strict was taken for the viewport, off by the body's margin. Containers are now sized by their padding box, only the document element counts as the viewport, and any layout or paint containment makes a containing block.

Built and tested against vue 3.6.0-rc.10; the peer range still starts at rc.8.

npm i ropav@0.15.1

Full changelog: v0.15.0...v0.15.1