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

Abierto
#7,398 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
7.1k
Forks
1.2k
Merge medio
1 d 2 h
PR fusionados (30 d)
147

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de nuxt/ui

Todos los issues de nuxt/ui

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.