Scroll ReplyWidget into view

Change-Id: I302346c85aacf9e410ff1468723b30fd04351032
This commit is contained in:
Ed Sanders 2019-11-21 08:12:24 -05:00
parent 994c38d68c
commit a17fb49a68

View file

@ -1,6 +1,7 @@
'use strict';
var $pageContainer,
scrollPadding = { top: 10, bottom: 10 },
replyWidgetPromise = mw.loader.using( 'ext.discussionTools.ReplyWidget' );
function setupComment( comment ) {
@ -55,6 +56,7 @@ function setupComment( comment ) {
}
widgetPromise.then( function ( replyWidget ) {
$( newListItem ).show();
replyWidget.scrollElementIntoView( { padding: scrollPadding } );
replyWidget.focus();
} );
} );