Skip to content

Empty div on Slideover when title or description props are not used #5336

@metkm

Description

@metkm

Environment

  • Operating System: Windows_NT
  • Node Version: v22.14.0
  • Nuxt Version: 4.1.3
  • CLI Version: 3.29.3
  • Nitro Version: 2.12.7
  • Package Manager: npm@11.6.0
  • Builder: -
  • User Config: modules, ssr, devtools, css, future, experimental, compatibilityDate, vite, eslint, icon
  • Runtime Modules: @nuxt/ui@4.0.1, @nuxt/eslint@1.9.0, motion-v/nuxt@1.7.3, @vueuse/nuxt@14.0.0, @pinia/nuxt@0.11.2, pinia-plugin-persistedstate/nuxt@4.5.0
  • Build Modules: -

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

v4.0.1

Reproduction

<USlideover side="left">
  ......

  <template #body>
    <p>body</p>
  </template>

  <template #actions>
    <UButton
      icon="i-lucide-arrow-left"
      variant="ghost"
      color="neutral"
      square
    />
  </template>
</USlideover>

Description

When using the Slideover component, if the title or description props are not used, the wrapper div element is not removed, which causes there to be empty gap because of the empty div.

Image Image

These screenshots show when the close button is present and the #actions slot is used

Additional context

<div :class="ui.wrapper({ class: props.ui?.wrapper })">
<DialogTitle v-if="title || !!slots.title" :class="ui.title({ class: props.ui?.title })">
<slot name="title">
{{ title }}
</slot>
</DialogTitle>
<DialogDescription v-if="description || !!slots.description" :class="ui.description({ class: props.ui?.description })">
<slot name="description">
{{ description }}
</slot>
</DialogDescription>
</div>

This div should have something like this

v-if="title || slots.title || description || slots.description"

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting initial review and prioritizationv4#4488

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions