jenkins-bot has submitted this change and it was merged.

Change subject: Only prevent default for handled keypresses
......................................................................


Only prevent default for handled keypresses

Firefox sends tab and shift-tab through the 'keypress' event, meaning
that preventing default for all keypress events was breaking tabbing.

It's probably safe for us to allow the default action through for
keypress events besides the ones we're specifically handling, despite
T91132 having trouble with respect to form submission.

Bug: T92449
Change-Id: If37f7383a8d1446f552df4eb4d1df1bacf6cb0e9
---
M src/elements/ButtonElement.js
M src/widgets/ComboBoxWidget.js
M src/widgets/DropdownWidget.js
M src/widgets/ToggleSwitchWidget.js
4 files changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Trevor Parscal: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/src/elements/ButtonElement.js b/src/elements/ButtonElement.js
index 1c4faad..fab6a1a 100644
--- a/src/elements/ButtonElement.js
+++ b/src/elements/ButtonElement.js
@@ -180,8 +180,8 @@
 OO.ui.ButtonElement.prototype.onKeyPress = function ( e ) {
        if ( !this.isDisabled() && ( e.which === OO.ui.Keys.SPACE || e.which 
=== OO.ui.Keys.ENTER ) ) {
                this.emit( 'click' );
+               return false;
        }
-       return false;
 };
 
 /**
diff --git a/src/widgets/ComboBoxWidget.js b/src/widgets/ComboBoxWidget.js
index f9920b3..9e4fe1e 100644
--- a/src/widgets/ComboBoxWidget.js
+++ b/src/widgets/ComboBoxWidget.js
@@ -168,8 +168,8 @@
        if ( !this.isDisabled() && ( e.which === OO.ui.Keys.SPACE || e.which 
=== OO.ui.Keys.ENTER ) ) {
                this.menu.toggle();
                this.input.$input[ 0 ].focus();
+               return false;
        }
-       return false;
 };
 
 /**
diff --git a/src/widgets/DropdownWidget.js b/src/widgets/DropdownWidget.js
index e287e13..ceaf0f4 100644
--- a/src/widgets/DropdownWidget.js
+++ b/src/widgets/DropdownWidget.js
@@ -144,6 +144,6 @@
 OO.ui.DropdownWidget.prototype.onKeyPress = function ( e ) {
        if ( !this.isDisabled() && ( e.which === OO.ui.Keys.SPACE || e.which 
=== OO.ui.Keys.ENTER ) ) {
                this.menu.toggle();
+               return false;
        }
-       return false;
 };
diff --git a/src/widgets/ToggleSwitchWidget.js 
b/src/widgets/ToggleSwitchWidget.js
index 3995897..8517dd4 100644
--- a/src/widgets/ToggleSwitchWidget.js
+++ b/src/widgets/ToggleSwitchWidget.js
@@ -92,6 +92,6 @@
 OO.ui.ToggleSwitchWidget.prototype.onKeyPress = function ( e ) {
        if ( !this.isDisabled() && ( e.which === OO.ui.Keys.SPACE || e.which 
=== OO.ui.Keys.ENTER ) ) {
                this.setValue( !this.value );
+               return false;
        }
-       return false;
 };

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If37f7383a8d1446f552df4eb4d1df1bacf6cb0e9
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Anomie <bjor...@wikimedia.org>
Gerrit-Reviewer: Bartosz DziewoƄski <matma....@gmail.com>
Gerrit-Reviewer: Trevor Parscal <tpars...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to