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();
|
super.unmount();
|
||||||
}
|
}
|
||||||
|
|
||||||
loadList() {
|
async loadList() {
|
||||||
super.loadList();
|
super.loadList();
|
||||||
const root = this.root();
|
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;
|
const {scrollHeight, clientHeight} = root;
|
||||||
if (scrollHeight > clientHeight) {
|
if (scrollHeight > clientHeight) {
|
||||||
root.scrollTop = root.scrollHeight;
|
root.scrollTop = root.scrollHeight;
|
||||||
|
|
Reference in a new issue