ui icon indicating copy to clipboard operation
ui copied to clipboard

Drawer-with-inset doesn't fully animate to edge of viewport

Open kalnode opened this issue 8 months ago • 0 comments

Environment

Is this bug related to Nuxt or Vue?

Nuxt Nuxt UI

Version

v3.1.0

Reproduction

You can actually see the issue right on Nuxt UI's demo page: https://ui.nuxt.com/components/drawer#inset

As an inset drawer closes, watch the viewport edge and notice the drawer doesn't fully animate offscreen; it actually remains visible for a moment before finally disappearing. I think it's easy to miss this subtle thing, however in my custom theme, the background and drawer have high-contrast, so the jankyness is noticeable.

Description

Given a Nuxt UI drawer instance with the inset option...

Issue: When closing an inset drawer, the drawer does not animate fully off the screen. Instead, the drawer animates to zero but is still visible for a moment before ultimately disappearing.

<UDrawer id="myDrawer"
v-model:open="store.myDrawer"
direction="top"
inset
class="myDrawer">
    <template #content>
        <div class="p-4 min-h-32 flex flex-col gap-4 overflow-hidden">
            <SomeComponent />
        </div>
    </template>
</UDrawer>

Current workaround:

This solves it for me, however doesn't take into account other cases.

For the closed state of my drawer-with-inset, I force top to 0.

.myDrawer[data-state='closed'] {
    top: calc(var(--spacing) * 0);
}

Additional context

No response

Logs


kalnode avatar Apr 25 '25 15:04 kalnode