Skip to content

[Bug] UPopover appears on top of UModal based on component declaration order #6550

@katrface

Description

@katrface

Environment

Environment

Vite project info (@nuxt/ui/vite):

Operating system Windows 11
CPU 13th Gen Intel(R) Core(TM) i7-13650HX
Node.js version v24.15.0
Package manager pnpm@11.0.9
Builder vite@8.0.8

Is this bug related to Nuxt or Vue?

Vue

Package

v4.x

Version

v4.8.1

Reproduction

https://codesandbox.io/p/devbox/boring-dew-4myj43?workspaceId=ws_DQFGyLZQ7dm97uDZVPVdBv (fix permission)

Description

If I try to use the UModal and UPopover components in this order:

    <UModal>
      <UButton label="Open modal" color="neutral" variant="subtle" />

      <template #content>
        <div class="h-48 m-4">Some modal</div>
      </template>
    </UModal>

    <UPopover :dismissible="false">
      <UButton label="Open popover" color="neutral" variant="subtle" />

      <template #content>
        <div class="size-48 m-4 inline-flex">Some popover</div>
      </template>
    </UPopover>

When opening the popover first and then the modal, the popover appears on top of the modal.

Image

If the components are declared in the opposite order, the bug no longer reproduces.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions