Conversation
|
Build successful! 🎉 |
|
Build successful! 🎉 |
|
Build successful! 🎉 |
| // if the virtualized item is not visible (aka display none on virtualized collection), | ||
| // we want to avoid reporting size 0 otherwise we get into a state where the virtualizer renders 0 items | ||
| // when it is hidden and thus won't remeasure when it is is unhidden | ||
| if (!isElementVisible(ref.current)) { |
There was a problem hiding this comment.
Wondering whether this should maybe be checked on the scrollParent instead. Not sure whether there is a realistic scenario of elements or sections toggling visibility individually though, just a thought.
I guess toggling visibility on an item could/would run into a similar issue with the size being stuck?
It would also be a bit of a pain to get the scrollRef down here, and traversing parents on every render is kind of expensive, so idk.
|
We should benchmark this. Not sure how expensive the isElementVisible check is, but this is a hot function. |
|
did some testing, the check visibility part of the flame graph seems negligable, less than 1% of the time taken. |
Closes #10171
✅ Pull Request Checklist:
📝 Test Instructions:
Test the "Virtualized Display None Toggle" gridlist story, the gridlist's items shouldn't disappear even when toggled a bunch
🧢 Your Project:
RSP