Skip to content

Commit 892ec9a

Browse files
committed
docs: correct code comment — rule diverges from jsx-a11y on role-fallback semantics
The previous comment said this matched jsx-a11y, but jsx-a11y validates every recognised role token while we check only the first recognised role per ARIA role-fallback semantics. Update the comment to reflect the PR description's stated behavior.
1 parent 7514197 commit 892ec9a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/rules/template-require-mandatory-role-attributes.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ function splitRoleTokens(value) {
4040
}
4141

4242
// For an ARIA role-fallback list like "combobox listbox", check required
43-
// attributes against the FIRST recognised role (the primary) — matches jsx-a11y.
43+
// attributes against the FIRST recognised role (the primary) per ARIA 1.2
44+
// role-fallback semantics — a user agent picks the first role it recognises.
45+
// Diverges from jsx-a11y, which validates every recognised token.
4446
function getMissingRequiredAttributes(roleTokens, foundAriaAttributes) {
4547
for (const role of roleTokens) {
4648
const roleDefinition = roles.get(role);

0 commit comments

Comments
 (0)