MCPcopy Create free account
hub / github.com/adobe/react-spectrum / waitForFocus

Function waitForFocus

perf/drivers.mjs:140–146  ·  view source on GitHub ↗
(page, selector)

Source from the content-addressed store, hash-verified

138// Keyboard drag starts from Record 0's drag button and targets drop indicators by label.
139const insertBetween = (a, b) => `[aria-label="Insert between Record ${a} and Record ${b}"]`;
140const waitForFocus = (page, selector) =>
141 page.waitForFunction(
142 // Fixtures live in the top-level document, with no shadow roots.
143 // oxlint-disable-next-line rsp-rules/shadow-safe-active-element
144 selector => document.activeElement === document.querySelector(selector),
145 selector
146 );
147async function startReorder({page}) {
148 await page.locator('[data-record="item-0"] [slot="drag"]').focus();
149 await page.keyboard.press('Enter');

Callers 2

startReorderFunction · 0.85
drivers.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected