File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1125,7 +1125,7 @@ export default class VirtualizedList extends StateSafePureComponent<
11251125 }
11261126 }
11271127
1128- componentDidUpdate ( prevProps : Props ) {
1128+ componentDidUpdate ( prevProps : Props , prevState : State ) {
11291129 const { data, extraData} = this . props ;
11301130 if ( data !== prevProps . data || extraData !== prevProps . extraData ) {
11311131 // clear the viewableIndices cache to also trigger
@@ -1147,6 +1147,15 @@ export default class VirtualizedList extends StateSafePureComponent<
11471147 if ( hiPriInProgress ) {
11481148 this . _hiPriInProgress = false ;
11491149 }
1150+
1151+ // Make sure to cancel any pending updates if maintainVisibleContentPositionAdjustment
1152+ // changed since they are now invalid.
1153+ if (
1154+ prevState . maintainVisibleContentPositionAdjustment !==
1155+ this . state . maintainVisibleContentPositionAdjustment
1156+ ) {
1157+ this . _updateCellsToRenderBatcher . dispose ( { abort : true } ) ;
1158+ }
11501159 }
11511160
11521161 _averageCellLength = 0 ;
You can’t perform that action at this time.
0 commit comments