mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
fallback from scrollBy() to setting scrollTop on IE11
This commit is contained in:
parent
02b8b37b4c
commit
8858cffc55
@ -101,7 +101,11 @@ export class TimelineView extends TemplateView<TimelineViewModel> {
|
||||
if (newAnchoredBottom !== this.anchoredBottom) {
|
||||
const bottomDiff = newAnchoredBottom - this.anchoredBottom;
|
||||
console.log(`restore: scroll by ${bottomDiff} as height changed`);
|
||||
if (typeof timeline.scrollBy === "function") {
|
||||
timeline.scrollBy(0, bottomDiff);
|
||||
} else {
|
||||
timeline.scrollTop = timeline.scrollTop + bottomDiff;
|
||||
}
|
||||
this.anchoredBottom = newAnchoredBottom;
|
||||
} else {
|
||||
// console.log("restore: bottom didn't change, must be below viewport");
|
||||
|
Loading…
Reference in New Issue
Block a user