Merge "CommentController: Scroll before focusing in showAndFocus"

This commit is contained in:
jenkins-bot 2022-07-07 20:26:23 +00:00 committed by Gerrit Code Review
commit 31c35992f4

View file

@ -346,12 +346,10 @@ CommentController.prototype.focus = function () {
CommentController.prototype.showAndFocus = function () {
var commentController = this;
this.focus();
// Calling can trigger a scroll-into-view within 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 } );
} );
this.replyWidget.scrollElementIntoView( { padding: scrollPadding } )
.then( function () {
commentController.focus();
} );
};
CommentController.prototype.teardown = function ( mode ) {