From 80445f1d70d1bb274483b0080d1ebdeac396e979 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 23 Jul 2015 14:32:49 +0930 Subject: [PATCH] Anchor scroll to bottom when live previewing reply --- framework/core/js/forum/src/components/ReplyComposer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/framework/core/js/forum/src/components/ReplyComposer.js b/framework/core/js/forum/src/components/ReplyComposer.js index b887f70c7..a6b42e619 100644 --- a/framework/core/js/forum/src/components/ReplyComposer.js +++ b/framework/core/js/forum/src/components/ReplyComposer.js @@ -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);