useAriaPropsForRole
诊断类别:lint/a11y/useAriaPropsForRole
¥Diagnostic Category: lint/a11y/useAriaPropsForRole
自从:v1.0.0
¥Since: v1.0.0
来源:
¥Sources:
强制具有 ARIA 角色的元素必须具有该角色所需的所有 ARIA 属性。
¥Enforce that elements with ARIA roles must have all required ARIA attributes for that role.
¥Examples
¥Invalid
code-block.jsx:1:7 lint/a11y/useAriaPropsForRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The element with the checkbox ARIA role does not have the required ARIA attributes.
> 1 │ <span role=“checkbox”></span>
│ ^^^^^^^^^^^^^^^
2 │
ℹ Missing ARIA prop(s):
- aria-checked
code-block.jsx:1:7 lint/a11y/useAriaPropsForRole ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✖ The element with the heading ARIA role does not have the required ARIA attributes.
> 1 │ <span role=“heading”></span>
│ ^^^^^^^^^^^^^^
2 │
ℹ Missing ARIA prop(s):
- aria-level
¥Valid
可访问性指南
Section titled 可访问性指南¥Accessibility guidelines
¥Resources
¥Related links