nuxt / nuxt/ui

UNavigationMenu dropdown width issue inside UHeader

Open
#6,409 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

Package

v4.x

Description

Hi there, I'm not sure if this is a bug or intended behavior, so I'm posting here..

When placing a UNavigationMenu with children inside the UHeader's default slot, the dropdown width becomes too narrow and truncates the child labels.

Is there a any recommended way to fix this?

Image
const items = computed<NavigationMenuItem[]>(() => [
  {
    label: 'Home',
    to: '/',
    active: route.path === '/',
  },
  {
    label: 'Assets',
    to: '/assets/dashboard',
    active: route.path.startsWith('/assets'),
    children: [
      {
        label: 'Dashboard',
        description: '',
        to: '/assets/dashboard',
        active: route.path === '/assets/dashboard'
      },
      {
        label: 'Request',
        to: '/assets/request',
        active: route.path === '/assets/request'
      },
    ],
  },
])

<template>
  <UHeader>
    <UNavigationMenu :items="items"  />
  </UHeader>
</template>

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided UHeader and UNavigationMenu example with the nested items. Compare the dropdown width and child-label rendering when UNavigationMenu is placed in UHeader's default slot. Done means the child labels no longer truncate, or the recommended configuration is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
tailwindcss, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.