Skip to content

Commit 5a32fe2

Browse files
committed
WIP
1 parent b99db90 commit 5a32fe2

4 files changed

Lines changed: 17 additions & 1 deletion

File tree

packages/react-virtual/e2e/app/main.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ const App = () => {
2525
count: 1002,
2626
getScrollElement: () => parentRef.current,
2727
estimateSize: () => 50,
28+
debug: true,
2829
})
2930

3031
return (

packages/react-virtual/e2e/app/test/scroll.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ test('scrolls to index 1000', async ({ page }) => {
66

77
await expect(page.locator('[data-testid="item-1000"]')).toBeVisible()
88

9+
if (process.env.CI) {
10+
await page.waitForTimeout(1_000)
11+
}
12+
913
const delta = await page.evaluate(() => {
1014
const item = document.querySelector('[data-testid="item-1000"]')
1115
const container = document.querySelector('#scroll-container')
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
1-
import { defineConfig } from '@playwright/test'
1+
import { defineConfig, devices } from '@playwright/test'
22

33
const PORT = 5173
44

55
export default defineConfig({
66
testDir: './e2e/app/test',
7+
workers: 1,
78
use: {
89
baseURL: `http://localhost:${PORT}`,
910
},
1011
webServer: {
1112
command: 'vite --config e2e/app/vite.config.ts',
1213
port: PORT,
1314
reuseExistingServer: !process.env.CI,
15+
stdout: 'pipe',
1416
},
17+
projects: [
18+
{
19+
name: 'chromium',
20+
use: { ...devices['Desktop Chrome'] },
21+
},
22+
],
1523
})

packages/virtual-core/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,6 +1003,9 @@ export class Virtualizer<
10031003

10041004
attempts++
10051005
if (attempts < maxAttempts) {
1006+
if (process.env.NODE_ENV !== 'production' && this.options.debug) {
1007+
console.info('Schedule retry', attempts, maxAttempts)
1008+
}
10061009
this.targetWindow.requestAnimationFrame(() => tryScroll(align))
10071010
} else {
10081011
console.warn(

0 commit comments

Comments
 (0)