diff --git a/modules/CommentController.js b/modules/CommentController.js index 3fafb9944..0c129ae24 100644 --- a/modules/CommentController.js +++ b/modules/CommentController.js @@ -345,12 +345,19 @@ CommentController.prototype.focus = function () { this.replyWidget.focus(); }; +/** + * Scroll the widget into view and focus it + */ CommentController.prototype.showAndFocus = function () { var commentController = this; - this.replyWidget.scrollElementIntoView( { padding: scrollPadding } ) - .then( function () { - commentController.focus(); + if ( this.replyWidgetPromise ) { + this.replyWidgetPromise.then( function ( replyWidget ) { + replyWidget.scrollElementIntoView( { padding: scrollPadding } ) + .then( function () { + commentController.focus(); + } ); } ); + } }; CommentController.prototype.teardown = function ( mode ) { diff --git a/modules/controller.js b/modules/controller.js index 393ac2b6a..2552c65f9 100644 --- a/modules/controller.js +++ b/modules/controller.js @@ -430,7 +430,6 @@ function init( $container, state ) { // If the reply widget is already open, activate it. // Reply links are also made unclickable using 'pointer-events' in CSS, but that doesn't happen // for new section links, because we don't have a good way of visually disabling them. - // (And it also doesn't work on IE 11.) if ( activeCommentId === commentId ) { activeController.showAndFocus(); return;