Editor: suggestion menu fails ARIA listbox rules, and toolbar toggles have no `aria-pressed`

Aperta
#7,398 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript

Direzione di ricerca

The suggestion menu markup is in useEditorMenu (the issue cites dist/runtime/composables/useEditorMenu.js; find its source), and the toolbar buttons are built in getButtonProps in EditorToolbar.vue. Start by reproducing with axe on an open "/" menu, then check the listbox, group, label and separator roles and the aria-pressed value for toggle kinds. Done when axe reports no failures for those three rules and toggle buttons expose aria-pressed that matches their active state, with one-shot kinds left unchanged.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

triage
Environment
  • Operating system: Linux 6.18.44-fc-v378
  • CPU: Intel(R) Xeon(R) Processor @ 2.30GHz (4 cores)
  • Node.js version: v22.23.4
  • nuxt/cli version: 4.0.1
  • Package manager: [email protected]
  • Nuxt version: 4.6.3
  • Nitro version: 2.13.5
  • Builder: [email protected]
  • Config: app, compatibilityDate, css, devtools, experimental, extends, hooks, icon, modules, nitro, routeRules, runtimeConfig, security, sentry, serverHandlers, sourcemap, ssr, typescript, ui, vite
  • Modules: slimAppTypeProgram(), @nuxt/[email protected], [email protected], [email protected], @sentry/nuxt/[email protected]
Is this bug related to Nuxt or Vue?

Nuxt

Package

v4.x

Version

4.12.0

Reproduction
  1. Render <UEditor> with <UEditorToolbar> and <UEditorSuggestionMenu> from the docs example.
  2. Type "/" and run axe on the page: the three rules above fail on the menu.
  3. Select bold text and inspect the Bold button: there is no aria-pressed attribute.
Description

1. Suggestion menu (useEditorMenu)

Found with axe-core 4.x on an open "/" menu and confirmed with a screen reader.

  • role="listbox" sits on the outer content element. Its children include the viewport
    (role="presentation"), group labels and separators, so the listbox owns elements that are not
    options or groups (axe aria-required-children).
  • The listbox has no accessible name (axe aria-input-field-name).
  • Separators carry role="separator" inside the listbox, which is not an allowed child.
  • Groups have a visible label but no aria-labelledby, so the group name is not announced.
  • The scrolling viewport is not focusable, so a keyboard user who cannot use the arrow keys
    cannot scroll it (axe scrollable-region-focusable).

Suggested change (what we patch locally in dist/runtime/composables/useEditorMenu.js):

  • move role="listbox" to the viewport, give it aria-label (an option, default "Suggestions")
    and tabindex="0";
  • each group: role="group" with aria-labelledby pointing at its label's id;
  • label: role="presentation" with that id; separator: role="presentation" and
    aria-hidden="true".

2. Toolbar toggles (EditorToolbar.vue)

Bold, Italic, the lists, Quote and the other toggle kinds show their active state through
active (colour and variant) only. No aria-pressed is set, so a screen reader announces
"Bold, button" whether or not the selection is bold (WCAG 4.1.2 Name, Role, Value).

Suggested change (what we patch locally): in getButtonProps, add
"aria-pressed": isToggle(item) ? isActive(item) : undefined, where isToggle is true for a
button item (no items) whose kind is mark, bulletList, orderedList, taskList,
blockquote, codeBlock, textAlign or heading. One-shot kinds (link, image,
horizontalRule, undo, redo) keep no aria-pressed. A custom handler could opt in through a
toggle: true field on the item instead of a naming rule.

Additional context

No response

Logs

Lingua principale
TypeScript
Stelle
7.1k
Fork
1.2k
Merge medio
1g 2h
PR unite (30g)
147

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di nuxt/ui

Tutte le issue di nuxt/ui

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.