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