mirror of
https://github.com/urbit/shrub.git
synced 2024-12-19 16:51:42 +03:00
VirtualScroller: lock scroll less aggressively
Prevents incorrect scroll adjustment
This commit is contained in:
parent
6a1f0e2ac9
commit
2e7b1cd41d
@ -361,10 +361,6 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
|
|||||||
// bail if we're going to adjust scroll anyway
|
// bail if we're going to adjust scroll anyway
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(this.initScroll) {
|
|
||||||
clearTimeout(this.initScroll);
|
|
||||||
this.initScroll = null;
|
|
||||||
}
|
|
||||||
if(this.saveDepth > 0) {
|
if(this.saveDepth > 0) {
|
||||||
log('bail', 'deep scroll queue');
|
log('bail', 'deep scroll queue');
|
||||||
return;
|
return;
|
||||||
@ -376,17 +372,15 @@ export default class VirtualScroller<T> extends Component<VirtualScrollerProps<T
|
|||||||
const startOffset = this.startOffset();
|
const startOffset = this.startOffset();
|
||||||
if (scrollTop < ZONE_SIZE) {
|
if (scrollTop < ZONE_SIZE) {
|
||||||
log('scroll', `Entered start zone ${scrollTop}`);
|
log('scroll', `Entered start zone ${scrollTop}`);
|
||||||
if (startOffset === 0 && onStartReached) {
|
if (startOffset === 0) {
|
||||||
onStartReached();
|
onStartReached && onStartReached();
|
||||||
|
this.scrollLocked = true;
|
||||||
}
|
}
|
||||||
const newOffset = Math.max(0, startOffset - this.pageDelta);
|
const newOffset = Math.max(0, startOffset - this.pageDelta);
|
||||||
if(newOffset < 10) {
|
if(newOffset < 10) {
|
||||||
this.loadBottom();
|
this.loadBottom();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(newOffset === 0) {
|
|
||||||
this.scrollLocked = true;
|
|
||||||
}
|
|
||||||
if(newOffset !== startOffset) {
|
if(newOffset !== startOffset) {
|
||||||
this.updateVisible(newOffset);
|
this.updateVisible(newOffset);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user