petyosi / react-virtuoso

The most powerful virtual list component for React
https://virtuoso.dev
MIT License
5.25k stars 301 forks source link

[BUG] Error while using Virtuoso with OverlayScrollbars, introduced in 2.5.0 #660

Closed Ethorsen closed 2 years ago

Ethorsen commented 2 years ago

Hi @petyosi

Describe the bug There is a crash when using Virtuoso with OverlayScrollbars as a custom scrollbar.

TypeError
Cannot read properties of null (reading 'dataset')
eval
https://yos1zo.csb.app/node_modules/react-virtuoso/dist/index.m.js:968:55
ResizeObserver.eval
https://yos1zo.csb.app/node_modules/react-virtuoso/dist/index.m.js:912:34

The error was introduced in 2.5.0 with the changes in src/hooks/useChangedChildSizes.ts i'm guessing

Reproduction https://codesandbox.io/s/react-virtuoso-custom-scrollbar-forked-yos1zo?file=/src/CustomScrollbar.js

To Reproduce Switch to Virtuoso 2.4.1 makes the error go away.

Switch to Virtuoso 2.5.0 creates the error.

Expected behavior No error.

Screenshots image

Desktop (please complete the following information): N/A

Additional context N/A

petyosi commented 2 years ago

Added details in #662