resize observe update
This commit is contained in:
@@ -27,7 +27,17 @@ class InfiniteScroller{
|
||||
|
||||
this.scroll=scroll;
|
||||
this.scroll.addEventListener("scroll",this.watchForChange.bind(this));
|
||||
new ResizeObserver(this.watchForChange.bind(this)).observe(div);
|
||||
{
|
||||
let oldheight=0;
|
||||
new ResizeObserver(_=>{
|
||||
const change=oldheight-this.div.offsetHeight;
|
||||
if(change>0){
|
||||
this.scroll.scrollTop+=change;
|
||||
}
|
||||
oldheight=this.div.offsetHeight;
|
||||
this.watchForChange();
|
||||
}).observe(div);
|
||||
}
|
||||
new ResizeObserver(this.watchForChange.bind(this)).observe(scroll);
|
||||
|
||||
await this.firstElement(initialId)
|
||||
|
Reference in New Issue
Block a user