-
-
Notifications
You must be signed in to change notification settings - Fork 306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Items list is not loaded when using createPortal and window.open (Chrome) #999
Comments
Now that's a fun case! First time I see a portal in another window. My gut feeling says that maybe the resize observer from the first window is not working in the other one? Since you've already investigated that, I'm happy to accept a PR. |
I did other change which I missed in the description. I also commented requestAnimationFrame which are not working when the tab is inactive. I'll try to uncomment requestAnimationFrame and find another way. |
@petyosi I was not sure whether I should open a new issue. I use Virtuoso 4.6.0 in a div all works fine and it did work ok for a long time on previous versions. When I update the package to 4.6.2, development works ok however the production build doesn't show any items. Revert back to 4.6.0, all ok. |
@paulincai Is this related to this issue? Not sure I follow. |
@petyosi I wouldn't know whether this is related to the same issue. Would be interesting to know if the issue above exists in 4.6.2 and similarly not in 4.6.0. |
@paulincai this issue exists even in 1.5.3 version (I didn't tested with earlier versions). |
Describe the bug
When I open a new window and add Virtuoso with createPortal, virtuoso-item-list is empty. I could reproduce this issue on Edge, Chrome. Firefox works ok. The browser should be maximized. (window.open should open a new tab and focus it instead of popup)
Reproduction
https://codesandbox.io/s/beautiful-kate-ftj8jl?file=/src/App.js
To Reproduce
Steps to reproduce the behavior:
Desktop (please complete the following information):
Additional context
I tried to find the cause of the issue (really interesting case for me) and the issue was connected to ResizeObserver. As far as I understand (not in Firefox this time 😄), ResizeObserver doesn't work when the element is not visible or maybe the tab is not visible. I added
callback(elRef)
at line 25 and it started to work.react-virtuoso/src/hooks/useSize.ts
Lines 12 to 26 in 12e53e5
The text was updated successfully, but these errors were encountered: