nuxt / ui

A UI Library for Modern Web Apps, powered by Vue & Tailwind CSS.
https://ui.nuxt.com
MIT License
3.45k stars 383 forks source link

UPopover displays panel in wrong place if used inside `container-type: inline-size;` declared on ancestor. #1753

Closed KonradDRAST closed 3 weeks ago

KonradDRAST commented 3 weeks ago

Environment


Version

2.8

Reproduction

Just use popover inside the element, that has container-type: inline-size; defined for container queries. I'm using the official Tailwind plugin for that: https://github.com/tailwindlabs/tailwindcss-container-queries, with the @container class.

Description

I've stumbled upon strange Popover panel placement when working on my app. Everywhere popover was working OK, but in one of the components, the panel was waaaay off from the proper position.

Upon investigation I've discovered that the issue is caused by a @container class on the root component element, that contains the UPopover.

It look like that: image

Once the @container class is removed, popover panel is back when it belongs: image

Additional context

No response

Logs

No response

benjamincanac commented 3 weeks ago

Have you checked https://github.com/nuxt/ui/issues/1351?

KonradDRAST commented 3 weeks ago

Have you checked #1351?

Och... I've somehow missed this one. Thanks!