Руководства по правилам axe
aria-required-attrcriticalaxe-core 4.12.1

Fix aria-required-attr axe errors

An ARIA role is missing state or value attributes required by that role, so the widget may be exposed incompletely.

Кого затрагивает

Screen-reader and other assistive-technology users who depend on roles, states and current values.

Связь с WCAG

4.1.2 Name, Role, Value (A)

Обнаружение

wcagc compares an element's explicit ARIA role with the attributes required for that role in axe-core's supported ARIA model.

Почему возникает эта ошибка

  • A custom widget sets role but omits the required state or value attributes.
  • A framework wrapper drops ARIA props before they reach the DOM.
  • The initial attributes exist but are not updated with component state.

Проблемная разметка

<div role="slider" aria-label="Volume"></div>

Исправленный код

<div role="slider" aria-label="Volume" aria-valuemin="0" aria-valuemax="100" aria-valuenow="50" tabindex="0"></div>

Проверьте исправление вручную

Operate the widget with a keyboard and screen reader. Confirm that its role, current value and state are announced and kept in sync after every interaction.

Границы автоматизации

Passing the structural rule does not prove that keyboard interaction works or that JavaScript updates the required attributes when the widget changes.

Источники и стандарты

Метаданные правила и ссылка Deque генерируются из axe-core 4.12.1. Ссылка W3C ведёт на нормативное руководство WCAG для соответствующего критерия.

Вопросы разработчиков

Should I add ARIA to every custom component?

No. Prefer a native HTML control whenever it provides the required semantics and interaction. Use ARIA for patterns native HTML cannot express.

Why is a missing ARIA attribute critical?

Without required state or value information, assistive technology may announce an incomplete widget and users may be unable to understand or operate it.

Проверьте отрисованную страницу

Одно нарушение редко встречается в одиночку

Запустите проверку страницы в wcagc, чтобы найти это правило, связанные проблемы WCAG, затронутые селекторы и пункты, требующие ручной оценки.

Проверить страницу