DLynch has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/334373 )

Change subject: MWSaveDialog: only focus summary if we're on the save panel
......................................................................

MWSaveDialog: only focus summary if we're on the save panel

Firefox throws exceptions when trying to focus hidden inputs. Using the
"preview" keyboard shortcut entirely bypasses the save panel, but the ready
process assumes it'll always be opened first.

Bug: T153958
Change-Id: Ifb3861116565e77c30b3874fe47889298c3ace6d
---
M modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor 
refs/changes/73/334373/1

diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js 
b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
index 687897b..6b46f06 100644
--- a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
+++ b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
@@ -584,8 +584,14 @@
 ve.ui.MWSaveDialog.prototype.getReadyProcess = function ( data ) {
        return ve.ui.MWSaveDialog.super.prototype.getReadyProcess.call( this, 
data )
                .next( function () {
-                       // This includes a #focus call
-                       this.editSummaryInput.moveCursorToEnd();
+                       // Support: Firefox
+                       // In Firefox, trying to focus a hidden input will 
throw an
+                       // exception. This would happen when opening the 
preview via
+                       // keyboard shortcut.
+                       if ( this.panels.currentItem === this.savePanel ) {
+                               // This includes a #focus call
+                               this.editSummaryInput.moveCursorToEnd();
+                       }
                }, this );
 };
 

-- 
To view, visit https://gerrit.wikimedia.org/r/334373
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ifb3861116565e77c30b3874fe47889298c3ace6d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to