Skip to content

Commit

Permalink
make sure onLayout calls _updateViewableItems immediately
Browse files Browse the repository at this point in the history
Summary:
Makes sure `onViewableItemsChanged` fires ASAP when `waitForInterations` is false.

This also works around another deeper bug where updates scheduled with `InteractionManager` aren't firing at all in some cases, and thus instead of just firing late, `onViewableItemsChanged` isn't firing until scroll which is not what we want with `waitForInterations: false`. That bug will require more digging.

Differential Revision: D14984333

fbshipit-source-id: 718b39670307c6bc16268759bdb513682745265d
  • Loading branch information
sahrens authored and facebook-github-bot committed Apr 17, 2019
1 parent 30a0ce2 commit efe6a0f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Libraries/Lists/VirtualizedList.js
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,7 @@ class VirtualizedList extends React.PureComponent<Props, State> {
}

this._computeBlankness();
this._updateViewableItems(this.props.data);
}

_onCellUnmount = (cellKey: string) => {
Expand Down

0 comments on commit efe6a0f

Please sign in to comment.