Skip to content

Commit

Permalink
fix: add InlineTextBox as a non-element a11y role
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Oct 12, 2023
1 parent 8a2b9f1 commit 5a1d6b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/puppeteer-core/src/cdp/AriaQueryHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import type {AwaitableIterable} from '../common/types.js';
import {assert} from '../util/assert.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';

const NON_ELEMENT_NODE_ROLES = new Set(['StaticText', 'InlineTextBox']);

const queryAXTree = async (
client: CDPSession,
element: ElementHandle<Node>,
Expand All @@ -35,7 +37,7 @@ const queryAXTree = async (
role,
});
return nodes.filter((node: Protocol.Accessibility.AXNode) => {
return !node.role || node.role.value !== 'StaticText';
return !node.role || !NON_ELEMENT_NODE_ROLES.has(node.role.value);
});
};

Expand Down

0 comments on commit 5a1d6b2

Please sign in to comment.