mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Anchor scroll to bottom when live previewing reply
This commit is contained in:
parent
9dc2616f55
commit
80445f1d70
|
@ -49,7 +49,12 @@ export default class ReplyComposer extends ComposerBody {
|
|||
if (content === discussion.replyContent) return;
|
||||
|
||||
discussion.replyContent = content;
|
||||
|
||||
const anchorToBottom = $(window).scrollTop() + $(window).height() >= $(document).height();
|
||||
m.redraw();
|
||||
if (anchorToBottom) {
|
||||
$(window).scrollTop($(document).height());
|
||||
}
|
||||
}, 50);
|
||||
|
||||
context.onunload = () => clearInterval(updateInterval);
|
||||
|
|
Loading…
Reference in New Issue
Block a user