mirror of
https://github.com/status-im/react-native.git
synced 2025-01-29 18:54:58 +00:00
Trigger nested VirtualizedLists to re-measure if their containing cell's onLayout fires
Reviewed By: sahrens Differential Revision: D8272040 fbshipit-source-id: c490ffa875bfd0547ac54d214c5ebbeb23c99942
This commit is contained in:
parent
30320f1fed
commit
4435f08771
@ -1074,6 +1074,17 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|||||||
} else {
|
} else {
|
||||||
this._frames[cellKey].inLayout = true;
|
this._frames[cellKey].inLayout = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const childListKeys = this._cellKeysToChildListKeys.get(cellKey);
|
||||||
|
if (childListKeys) {
|
||||||
|
for (let childKey of childListKeys) {
|
||||||
|
const childList = this._nestedChildLists.get(childKey);
|
||||||
|
childList &&
|
||||||
|
childList.ref &&
|
||||||
|
childList.ref.measureLayoutRelativeToContainingList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this._computeBlankness();
|
this._computeBlankness();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1084,7 +1095,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_measureLayoutRelativeToContainingList(): void {
|
measureLayoutRelativeToContainingList(): void {
|
||||||
UIManager.measureLayout(
|
UIManager.measureLayout(
|
||||||
ReactNative.findNodeHandle(this),
|
ReactNative.findNodeHandle(this),
|
||||||
ReactNative.findNodeHandle(
|
ReactNative.findNodeHandle(
|
||||||
@ -1113,7 +1124,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
|
|||||||
if (this._isNestedWithSameOrientation()) {
|
if (this._isNestedWithSameOrientation()) {
|
||||||
// Need to adjust our scroll metrics to be relative to our containing
|
// Need to adjust our scroll metrics to be relative to our containing
|
||||||
// VirtualizedList before we can make claims about list item viewability
|
// VirtualizedList before we can make claims about list item viewability
|
||||||
this._measureLayoutRelativeToContainingList();
|
this.measureLayoutRelativeToContainingList();
|
||||||
} else {
|
} else {
|
||||||
this._scrollMetrics.visibleLength = this._selectLength(
|
this._scrollMetrics.visibleLength = this._selectLength(
|
||||||
e.nativeEvent.layout,
|
e.nativeEvent.layout,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user