Skip to content

Commit bcbebf6

Browse files
committed
lint: sync INTERACTIVE_ROLES util — remove tooltip per WAI-ARIA 1.2 §5.3.3
1 parent 7687fdd commit bcbebf6

1 file changed

Lines changed: 6 additions & 8 deletions

File tree

lib/utils/interactive-roles.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,19 @@ const { roles } = require('aria-query');
1010
// aria-query's taxonomy, but supports `aria-activedescendant` and is widget-
1111
// like in practice. jsx-a11y and lit-a11y add it for the same reason.
1212
//
13-
// `tooltip` is also addedARIA 1.2 doesn't cleanly categorize tooltip under
14-
// the widget taxonomy (aria-query's superClass is `structure/section`), but
15-
// tooltips with interactive content (close buttons, links) are common and our
16-
// existing test suite treats them as interactive.
13+
// `tooltip` is intentionally NOT added. Per WAI-ARIA 1.2 §5.3.3 — Document
14+
// Structure Roles (https://www.w3.org/TR/wai-aria-1.2/#tooltip), tooltip is
15+
// a document-structure role, not a widget; the spec says "document structures
16+
// are not usually interactive." jsx-a11y and lit-a11y agree.
1717
module.exports.INTERACTIVE_ROLES = buildInteractiveRoleSet();
1818

1919
function buildInteractiveRoleSet() {
20-
const result = new Set(['toolbar', 'tooltip']);
20+
const result = new Set(['toolbar']);
2121
for (const [role, def] of roles) {
2222
if (def.abstract) {
2323
continue;
2424
}
25-
const descendsFromWidget = (def.superClass || []).some((chain) =>
26-
chain.includes('widget')
27-
);
25+
const descendsFromWidget = (def.superClass || []).some((chain) => chain.includes('widget'));
2826
if (descendsFromWidget) {
2927
result.add(role);
3028
}

0 commit comments

Comments
 (0)