WindowScroll + Masonry + AutoSizer + CellMeasurer cells are not resized
See original GitHub issueI have made a small setup to display a bug when using WindowScroll + Masonry + AutoSizer + CellMeasurer.
The expectation is that cellRenderer
will receive proper style
with proper width
but in fact it always gets defaultWidth
:
https://codesandbox.io/s/73921rmy0x
I have fixed it with the line //FIXME NASTY HACK
but it think it should be done differently.
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (21 by maintainers)
Top Results From Across the Web
React Virtualized Masonry does not resize with the browser
I am using react-virtualized Masonry component. You can see how the items rearrange and the component is correctly resized when the browser ...
Read more >Rendering large lists with React Virtualized - LogRocket Blog
AutoSizer. It automatically adjusts the width and height of another component. CellMeasurer. It automatically measures a cell's contents by ...
Read more >A React virtualized, autosizing masonry component
An autosizing virtualized masonry component which only renders items ... Overscanning allows the tab key to focus on the next (not yet ...
Read more >types/react-virtualized@9.21.21 - jsDocs.io
Decorator component that automatically adjusts the width and height of a single child. Child component should not be declared as a child but ......
Read more >How to use the react-virtualized.AutoSizer function in ... - Snyk
Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Finally had time for this, and managed to make this work.
I’ve found in the masonry example the reset method, which calls
That’s exactly what I was looking for.
https://codesandbox.io/s/6x6qkoprk sandbox updated, bug is gone.
I presume this does not perform well especially if scrolled deep.
Correct. The CellMeasurerCache is used for both Masonry as well as List/Grid/Table. Masonry is not built to support async measurements. The other three are. That’s why the docs list the Masonry constraint.
Your follow up question is better suited for Stack Overflow or Slack than GitHub. I suggest asking there!