Fix List View _updateVisibleRows firing for all row component at view loading time issue
Summary: Sometimes list view row components(even the ones unseen) have a frame but its x and y is 0 or uninitialized at view loading time, which will lead to _updateVisibleRows firing for all the row components incorrectly at loading time. This is to make the code more defensive. Reviewed By: sahrens Differential Revision: D3308515 fbshipit-source-id: 0e30fdf10345629bfd9de3fe0ad641bb1903fe00
This commit is contained in:
parent
0c40f96c32
commit
34907c3810
|
@ -602,6 +602,9 @@ var ListView = React.createClass({
|
|||
var rowVisible = visibleSection[rowID];
|
||||
var min = isVertical ? frame.y : frame.x;
|
||||
var max = min + (isVertical ? frame.height : frame.width);
|
||||
if ((!min && !max) || (min === max)) {
|
||||
break;
|
||||
}
|
||||
if (min > visibleMax || max < visibleMin) {
|
||||
if (rowVisible) {
|
||||
visibilityChanged = true;
|
||||
|
|
Loading…
Reference in New Issue