Listview display none#6357
Conversation
|
GET_BUILD |
|
## API Changes
unknown top level export { type: 'any' } |
| let layoutNode = this.buildChild(node, 0, y); | ||
| y = layoutNode.layoutInfo.rect.maxY; | ||
| nodes.push(layoutNode); | ||
| this.validRect.height && nodes.push(layoutNode); |
There was a problem hiding this comment.
what is the height at this point? 0? undefined?
I think it'd be better to be a little more explicit and check if it's > 0, and if it's undefined, it'd be good to add a !isNaN
| } | ||
|
|
||
| updateItemSize(key: Key, size: Size) { | ||
| if (size.height === 0) {return false;} |
There was a problem hiding this comment.
It's not clear if it is a safe change. Probably the height of a list item is 0 only if display:none set.
On the other hand if somehow the item size is small enough (say 1), react will throw the same exception even if the ListView is visible. This is because after render the size is calculated (1 in this case) and a re-render will add one more item to the visible item's list, which will notice it's size and render again... If the collection is large enough react will treat it as an infinite recursion.
There was a problem hiding this comment.
The page does not crash if padding is set to 1 on ListLayout, but this is not configurable. Can be verified by setting the padding in ListView.tsx.
|
Closing as resolved by #6497 |
Closes #6298
✅ Pull Request Checklist:
📝 Test Instructions:
ListView Story "display: none with many items" does not crash
🧢 Your Project: