1
0
mirror of https://github.com/flarum/core.git synced 2025-10-13 07:54:25 +02:00

Fix PostStream Reply Scroll (#2366)

- Add an index to reply placeholder so we can scroll to it directly when replying.
- Stop pretending that the currently broken `bottom` scroll functionality works, and explicitly call it `reply` scrolling to be clearer
- Directly get target from state
- Explicitly scroll to placeholder on reply
- Clean up scrollToItem code a bit
- Account for edge case where index is undefined when scrolling to post

Co-authored-by: Wadim Kalmykov <36057469+w-4@users.noreply.github.com>
This commit is contained in:
Alexander Skvortsov
2020-10-15 17:46:02 -04:00
committed by GitHub
parent cd05ec6589
commit f534398645
3 changed files with 38 additions and 36 deletions

View File

@@ -96,7 +96,9 @@ class PostStreamState {
// If we want to go to the reply preview, then we will go to the end of the
// discussion and then scroll to the very bottom of the page.
if (number === 'reply') {
return this.goToLast();
const resultPromise = this.goToLast();
this.targetPost.reply = true;
return resultPromise;
}
this.paused = true;