forked from mystiq/hydrogen-web
yield for browser to render before checking content height
This commit is contained in:
parent
4044ac56c5
commit
7291cac834
1 changed files with 4 additions and 1 deletions
|
@ -92,9 +92,12 @@ export class TimelineList extends ListView {
|
|||
super.unmount();
|
||||
}
|
||||
|
||||
loadList() {
|
||||
async loadList() {
|
||||
super.loadList();
|
||||
const root = this.root();
|
||||
// yield so the browser can render the list
|
||||
// and we can measure the content below
|
||||
await Promise.resolve();
|
||||
const {scrollHeight, clientHeight} = root;
|
||||
if (scrollHeight > clientHeight) {
|
||||
root.scrollTop = root.scrollHeight;
|
||||
|
|
Loading…
Reference in a new issue