VariableSizeTree height does not behave as expected from upgrading to v2.0.0
See original GitHub issueI have a use case where the parent’s height is different from the children’s height. This was working fine in v1.0.2. However, after upgrading to v2.0.0 all the elements seem to be the same as the parent’s height.
After some investigation, it looks like getItemSize()
is not being called after toggle. This is due to lastMeasuredIndex
in VariableSizeList
in react-window
is not reset to -1 after children are added to the records (which is the case in the v1.0.2).
Adding resetAfterId(record.data.id, true)
in toggle()
resolves the issue. Just wondering if there is a proper fix for this issue. I can provide code examples if this is not clear. Thanks!
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Drag and Drop · Issue #2 · Lodin/react-vtree - GitHub
VariableSizeTree height does not behave as expected from upgrading to v2.0.0 #25. Closed. @sjrules sjrules mentioned this issue on Apr 30, ...
Read more >react-vtree - npm
React component for efficiently rendering large tree structures. Latest version: 2.0.4, last published: 2 years ago. Start using react-vtree ...
Read more >Newest 'viewbox' Questions - Stack Overflow
A real width and height do not appear in 'ActualWidth' or 'ActualHeight' [duplicate] ... Expected Behavior: Icon to fit only the area of...
Read more >On the Analysis of Hyper-Parameter Space for a Genetic ...
Hyper-parameters are configuration variables that reg- ulate or control the behavior of an optimization or learning algorithm (Birattari, 2009; Sipper et al,.
Read more >October - Ayende @ Rahien
I'm currently doing something that I would rather not do. I'm doing significant refactoring to the lowest level of RavenDB, preparing some ...
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 Free
Top 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
@Lodin worked perfectly. Thanks!
Yes here is a small example: https://github.com/ctan1345/react-vtree-height-issue
When you click
-
onChild #1
then clickExpand by recompute tree
, you can see the height ofChild #2
is not set properly.Whereas when you expand via
toggle()
, it behaves as expected since your last fix.