ReplyWidget: Defer scrollElementIntoView

Prevents VE from cancelling this scroll, and so not full scrolling the
widget into view.

Change-Id: I5b242fa2c60b87a52935f86f95d6c0efde2b74bc
This commit is contained in:
Ed Sanders 2021-03-24 12:58:28 +00:00
parent 86485dfc83
commit d5450abe39

View file

@ -237,8 +237,13 @@ CommentController.prototype.focus = function () {
};
CommentController.prototype.showAndFocus = function () {
this.replyWidget.scrollElementIntoView( { padding: scrollPadding } );
var commentController = this;
this.focus();
// Calling can trigger a scroll-into-view withing VE, so wait for this to
// happen so it doesn't cancel our scrolling of the whole widget into view
setTimeout( function () {
commentController.replyWidget.scrollElementIntoView( { padding: scrollPadding } );
} );
};
CommentController.prototype.teardown = function ( abandoned ) {