Skip to content

Commit

Permalink
fix: add InlineTextBox as a non-element a11y role (#11142)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN committed Oct 13, 2023
1 parent b020e77 commit 8aa6cb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/puppeteer-core/src/cdp/AriaQueryHandler.ts
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 8aa6cb3

Please sign in to comment.