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

Function traverseDeep

perf/drivers.mjs:169–190  ·  view source on GitHub ↗
(page, viewport)

Source from the content-addressed store, hash-verified

167// Traverses the collection in this mounted instance so layout history accumulates.
168// A direct scrollTop assignment would skip the workload these scenarios target.
169async function traverseDeep(page, viewport) {
170 let list = page.locator(viewport);
171 await list.hover();
172 let box = await list.boundingBox();
173 let session = await page.context().newCDPSession(page);
174 try {
175 await session.send('Input.synthesizeScrollGesture', {
176 x: box.x + box.width / 2,
177 y: box.y + box.height / 2,
178 yDistance: -deepScrollStart,
179 speed: 40000,
180 gestureSourceType: 'mouse',
181 preventFling: true
182 });
183 } finally {
184 await session.detach();
185 }
186 await page.waitForFunction(
187 ([viewport, start]) => Math.abs(document.querySelector(viewport).scrollTop - start) <= 1,
188 [viewport, deepScrollStart]
189 );
190}
191
192async function prepareDeepTable({page}) {
193 await page.locator('[data-record="item-0"]').waitFor();

Callers 2

prepareDeepTableFunction · 0.85
prepareDeepVariableFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected