Fix aria-valid-attr-value axe errors
An ARIA attribute contains a value outside the type or allowed tokens defined for that attribute.
Кого затрагивает
Assistive-technology users who rely on accurate expanded, selected, checked and relationship states.
Связь с WCAG
4.1.2 Name, Role, Value (A)
Обнаружение
wcagc validates rendered ARIA values against the boolean, token, number or ID-reference form expected by axe-core.
Почему возникает эта ошибка
- Human-readable yes/no values are used where ARIA expects true/false.
- An ID-reference attribute points to a missing element.
- Undefined application state is serialized into the DOM as an invalid string.
Проблемная разметка
<button aria-expanded="yes" aria-controls="filters">Filters</button>Исправленный код
<button aria-expanded="true" aria-controls="filters">Filters</button>Проверьте исправление вручную
Change the widget state and inspect the accessibility tree. Confirm that the corrected value updates at the same moment as the visible state and references an existing target where required.
Границы автоматизации
A syntactically valid value may still be stale, point to the wrong element or misrepresent the visible state; those relationships require interaction testing.
Источники и стандарты
Метаданные правила и ссылка Deque генерируются из axe-core 4.12.1. Ссылка W3C ведёт на нормативное руководство WCAG для соответствующего критерия.
Вопросы разработчиков
Are ARIA boolean values real HTML booleans?
No. In markup they are string tokens such as true or false. Presence alone does not mean true.
Why does aria-controls fail when the value looks valid?
ID-reference attributes must point to an element that exists in the rendered document. Check timing, conditional rendering and duplicate IDs.
Одно нарушение редко встречается в одиночку
Запустите проверку страницы в wcagc, чтобы найти это правило, связанные проблемы WCAG, затронутые селекторы и пункты, требующие ручной оценки.
Проверить страницу