Skip to content

Conversation

@tnajdek
Copy link
Contributor

@tnajdek tnajdek commented Sep 25, 2025

The style prop isn’t properly forwarded from List to useVirtualizer, hence it’s undefined here and the subsequent early return fails. I wrote a quick test and a fix.

@vercel
Copy link

vercel bot commented Sep 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
react-window Ready Ready Preview Sep 26, 2025 11:48am

Copy link
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow. That's kind of an embarrassing oversight.

Mind doing the same change for Grid?

Comment on lines 691 to 695
window.ResizeObserver = vi.fn(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
disconnect: vi.fn()
}));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
window.ResizeObserver = vi.fn(() => ({
observe: vi.fn(),
unobserve: vi.fn(),
disconnect: vi.fn()
}));
simulateUnsupportedEnvironmentForTest();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’m not sure how this would work. From what I can see in the code, simulateUnsupportedEnvironmentForTest() sets the ResizeObserver to null. However, my goal here is to mock the object so that I can count executions, which is done at the end of the test with expect(window.ResizeObserver).toHaveBeenCalledTimes(0).

@tnajdek
Copy link
Contributor Author

tnajdek commented Sep 26, 2025

Mind doing the same change for Grid?

Sure, updated!

@bvaughn
Copy link
Owner

bvaughn commented Sep 26, 2025 via email

@tnajdek
Copy link
Contributor Author

tnajdek commented Sep 26, 2025

Fair point, updated!

Copy link
Owner

@bvaughn bvaughn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks :)

@bvaughn bvaughn merged commit 2cd8402 into bvaughn:master Sep 26, 2025
6 checks passed
@bvaughn
Copy link
Owner

bvaughn commented Sep 26, 2025

Fix published in [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants