forked from mirrors/akkoma-fe
Fix timeline jump when scrolling
Ref: tree-threading
This commit is contained in:
parent
20880cdf0b
commit
f8c5cbcd0d
2 changed files with 18 additions and 4 deletions
|
@ -469,7 +469,24 @@ const conversation = {
|
||||||
} else {
|
} else {
|
||||||
this.inlineDivePosition = id
|
this.inlineDivePosition = id
|
||||||
}
|
}
|
||||||
this.setHighlight(id)
|
// Because the conversation can be unmounted when out of sight
|
||||||
|
// and mounted again when it comes into sight,
|
||||||
|
// the `mounted` or `created` function in `status` should not
|
||||||
|
// contain scrolling calls, as we do not want the page to jump
|
||||||
|
// when we scroll with an expanded conversation.
|
||||||
|
//
|
||||||
|
// Now the method is to rely solely on the `highlight` watcher
|
||||||
|
// in `status` components.
|
||||||
|
// In linear views, all statuses are rendered at all times, but
|
||||||
|
// in tree views, it is possible that a change in active status
|
||||||
|
// removes and adds status components (e.g. an originally child
|
||||||
|
// status becomes an ancestor status, and thus they will be
|
||||||
|
// different).
|
||||||
|
// Here, let the components be rendered first, in order to trigger
|
||||||
|
// the `highlight` watcher.
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.setHighlight(id)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
goToCurrent () {
|
goToCurrent () {
|
||||||
this.tryScrollTo(this.diveRoot || this.topLevel[0].id)
|
this.tryScrollTo(this.diveRoot || this.topLevel[0].id)
|
||||||
|
|
|
@ -439,9 +439,6 @@ const Status = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
|
||||||
this.scrollIfHighlighted(this.highlight)
|
|
||||||
},
|
|
||||||
watch: {
|
watch: {
|
||||||
'highlight': function (id) {
|
'highlight': function (id) {
|
||||||
this.scrollIfHighlighted(id)
|
this.scrollIfHighlighted(id)
|
||||||
|
|
Loading…
Reference in a new issue