VirtualScroller: prevent crash on iOS

Fixes urbit/landscape#515
This commit is contained in:
Liam Fitzgerald 2021-03-04 12:02:58 +10:00
parent 053ca8bd3c
commit 8bf4e66f7b
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB

View File

@ -151,10 +151,6 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
if(size !== prevProps.size) {
if(this.scrollLocked) {
this.updateVisible(0);
if(IS_IOS) {
(this.updateVisible as any).flush();
}
this.resetScroll();
}
@ -369,9 +365,6 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
return;
}
this.updateVisible(Math.max(offset - this.pageDelta, 0));
if(IS_IOS) {
(this.updateVisible as any).flush();
}
requestAnimationFrame(() => {
ref = this.childRefs.get(index);
this.savedIndex = null;