Skip to content

Commit b0851f7

Browse files
committed
Merge branch 'master' into muhammad/arch-64-fb-submit-master
* master: skip dismiss all if all rows are hidden (facebook#19564) Trigger nested VirtualizedLists to re-measure if their containing cell's onLayout fires
2 parents ab60bfd + de18dd2 commit b0851f7

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

Libraries/Lists/VirtualizedList.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1074,6 +1074,17 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10741074
} else {
10751075
this._frames[cellKey].inLayout = true;
10761076
}
1077+
1078+
const childListKeys = this._cellKeysToChildListKeys.get(cellKey);
1079+
if (childListKeys) {
1080+
for (let childKey of childListKeys) {
1081+
const childList = this._nestedChildLists.get(childKey);
1082+
childList &&
1083+
childList.ref &&
1084+
childList.ref.measureLayoutRelativeToContainingList();
1085+
}
1086+
}
1087+
10771088
this._computeBlankness();
10781089
}
10791090

@@ -1084,7 +1095,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
10841095
}
10851096
};
10861097

1087-
_measureLayoutRelativeToContainingList(): void {
1098+
measureLayoutRelativeToContainingList(): void {
10881099
UIManager.measureLayout(
10891100
ReactNative.findNodeHandle(this),
10901101
ReactNative.findNodeHandle(
@@ -1113,7 +1124,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
11131124
if (this._isNestedWithSameOrientation()) {
11141125
// Need to adjust our scroll metrics to be relative to our containing
11151126
// VirtualizedList before we can make claims about list item viewability
1116-
this._measureLayoutRelativeToContainingList();
1127+
this.measureLayoutRelativeToContainingList();
11171128
} else {
11181129
this._scrollMetrics.visibleLength = this._selectLength(
11191130
e.nativeEvent.layout,

Libraries/ReactNative/YellowBox.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ class YellowBox extends React.Component<
424424
];
425425
return (
426426
<View style={inspector ? styles.fullScreen : listStyle}>
427-
{!inspector && (
427+
{!inspector && rows.length > 0 && (
428428
<TouchableHighlight
429429
style={styles.dismissAllContainer}
430430
onPress={() => this.dismissWarning(null)}>

0 commit comments

Comments
 (0)