more checks for staying at bottom
This commit is contained in:
parent
12ad9c00b9
commit
71dd54fc0e
4 changed files with 27 additions and 7 deletions
|
@ -55,10 +55,16 @@ class InfiniteScroller{
|
|||
currrunning:boolean=false;
|
||||
async addedBottom(){
|
||||
this.updatestuff();
|
||||
const scrollBottom=this.scrollBottom;
|
||||
const func=this.snapBottom();
|
||||
await this.watchForChange();
|
||||
if(scrollBottom<30){
|
||||
this.scroll.scrollTop=this.scroll.scrollHeight;
|
||||
func();
|
||||
}
|
||||
snapBottom(){
|
||||
const scrollBottom=this.scrollBottom;
|
||||
return ()=>{
|
||||
if(scrollBottom<30){
|
||||
this.scroll.scrollTop=this.scroll.scrollHeight;
|
||||
}
|
||||
}
|
||||
}
|
||||
private async watchForTop():Promise<void>{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue