mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
yield for browser to render before checking content height
This commit is contained in:
parent
4044ac56c5
commit
7291cac834
@ -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 New Issue
Block a user