jenkins-bot has submitted this change and it was merged. (
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(-)
Approvals:
Bartosz Dziewoński: Looks good to me, approved
jenkins-bot: Verified
diff --git a/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
b/modules/ve-mw/ui/dialogs/ve.ui.MWSaveDialog.js
index 687897b..e7c0a39 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.getCurrentItem() === 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: merged
Gerrit-Change-Id: Ifb3861116565e77c30b3874fe47889298c3ace6d
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/VisualEditor
Gerrit-Branch: master
Gerrit-Owner: DLynch <[email protected]>
Gerrit-Reviewer: Bartosz Dziewoński <[email protected]>
Gerrit-Reviewer: Esanders <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits