question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

VariableSizeTree height does not behave as expected from upgrading to v2.0.0

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ctan1345commented, Aug 10, 2020

@Lodin worked perfectly. Thanks!

1reaction
ctan1345commented, Aug 9, 2020

Yes here is a small example: https://github.com/ctan1345/react-vtree-height-issue

When you click - on Child #1 then click Expand by recompute tree, you can see the height of Child #2 is not set properly.

Whereas when you expand via toggle(), it behaves as expected since your last fix.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found