mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
restore bottom of timeline initially after attach to DOM
this will also load more items if the viewport isn't filled
This commit is contained in:
parent
e89f60bac0
commit
ab67ac00b1
@ -71,6 +71,11 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
|||||||
private tilesView?: TilesListView;
|
private tilesView?: TilesListView;
|
||||||
|
|
||||||
render(t: TemplateBuilder, vm: TimelineViewModel) {
|
render(t: TemplateBuilder, vm: TimelineViewModel) {
|
||||||
|
// assume this view will be mounted in the parent DOM straight away
|
||||||
|
requestAnimationFrame(() => {
|
||||||
|
// do initial scroll positioning
|
||||||
|
this.restoreScrollPosition();
|
||||||
|
});
|
||||||
this.tilesView = new TilesListView(vm.tiles, () => this.restoreScrollPosition());
|
this.tilesView = new TilesListView(vm.tiles, () => this.restoreScrollPosition());
|
||||||
return t.div({className: "Timeline bottom-aligned-scroll", onScroll: () => this.onScroll()}, [
|
return t.div({className: "Timeline bottom-aligned-scroll", onScroll: () => this.onScroll()}, [
|
||||||
t.view(this.tilesView)
|
t.view(this.tilesView)
|
||||||
|
Loading…
Reference in New Issue
Block a user