mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-25 11:16:51 +00:00
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
This commit is contained in:
parent
fb48db7227
commit
b976f2cf38
|
@ -584,8 +584,14 @@ ve.ui.MWSaveDialog.prototype.getSetupProcess = function ( data ) {
|
|||
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 );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue