nuxt / nuxt/ui

UNavigationMenu not keyboard accessible with items that have children and are a link themselves

Open
#6,587 2 comments 1 reaction 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

Environment

Not relevant, see playground.

Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

4.8.2

Reproduction

https://play.ui.nuxt.com/#eNqtV01v4zYQ/SsDX9wCK+vWg+FdtEjR3QC72wJJDsU6aGhxJLGhOAI/7GiD/PcOqci149jQJvEhisTh8L3HmeHwfvJb287WASfzycIVVrUeHPrQghamer+ceLecfFga1bRkPfiuRbiHr2KtKuEVmS9owrnHBh6gtNTA9FcT7nwe1HRpAB5n3Vssh3FeioeWpiDjPCie6uA9sMHi0Om36w8/fYt+7uMfYEgr1HOYfgxK4vRd/1GxJ/6mMh0K/pytiG4zatEMBp54OJdUuLxC75WpMueF9SgHi6JWWlpkN2m1+HtccXfVc+MtyVBEhMPM+JPY68af2eqPoHUHzncaJQgjoQjOU6O+i5VGKIgVMWi8g5IsfGWtZru+npKpKbioVz/6sLV8Fh6z0joJeBzeZxTWQE0blgVUP6WHSaZUVbCYQMHVOY9CR8GCaFutiuT3JNZCU5CZpI3RJORI0DEMTjl1jdLbrT6k8zcFqMUawZCveWcjK0nvoI/C6Aw2ihnWTJHlVx5E4N1gMgUT72bjUJ6RJnsa5kb4ok6xdxzsWU3kEAS0VjXCdkl3AQaDt0LzDvAqfZYk3S+F0hvFJmcXF+BrbHAk3Mtoe3KnqDotaSHMNm73gnbVQXBJ5xrhptDCuRvI4SaoG2ZFrQOmsBM4sz6sZt7tYO//uY6PnseT9D6L67mYL1vNnzKQwouV4NQ4zPGEdn/2uPyWWCqDFzVXrCL4k9tdclBmHu/8cRl/T97ADe5Svp/Mp+c55D2sbOtoXAxw2fhzjVaL7rU8lGvZC8dpQ1Lo3GmeSOyaEyum3Is4Mbos+ojwxtK5JOH2cL6KjI/eXkshOfnBuE55dPzsujsW0XvzBB9Ca5yDtwF/KMY/K7NXoF6g4RWXsHhERFdJQHChRdvSBi1n+QnlEoVcRwijNv1LDLi3Dd8X7XiPO80fB3y/k3kzBlpxyFLJT3M7RmmzhZE1Ecco7H+JSpmDJuJNcLeiwjG42W6AMA4ytbGYvBleEwVL0SKV0BQPO+Gh5K6Gy7iwFNKx7a2qKi6DqPm0Nftt3BFejzjHkbJUWXSvPYb4ONswWD481Hcy3O3BSti+95Mx9hG8cLfx7E6rjUuFwXp86fuo/KewOih7ji8ITCG+u6zi1PzfZiVkxRVu+su2XiUstfetm+d5b8ztRZMPF47BTFhu89n0nxVfYfpS8yymT6jbY4W4ULZgYPWOiVSp8su+6iavS3P989Is8l5wviXxC19bOIw88hvA4mq/FMA8XXj4WpWeywmkForfN1nJFwf4l5suVXZZwTqj5fGc/SzyHaeTh/8AO51Kig==

Description

I pasted the first example in the docs from UNavigation (https://ui.nuxt.com/docs/components/navigation-menu#items). The issue is that top level items can have its own 'to' property but also have children. When tabbing through this list there is no way to open the dropdown and access the children. Pressing space/enter will navigate to the item link.

I believe the dropdown chevron should be focusable by keyboard explicitly and that would solve this problem. I added tabindex="0" to the linkTrailing slot and that already works pretty well.

Additional context

No response

Logs

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 with the UNavigation example in the linked documentation and reproduce the keyboard behavior in the provided playground. Check how a top-level item with both a to property and children handles focus and activation; done means keyboard users can open the dropdown and reach its children without losing normal link navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
accessibility, 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.