Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/193099
Change subject: InputWidget: Focus checkboxes and radios when the label is
clicked, too
......................................................................
InputWidget: Focus checkboxes and radios when the label is clicked, too
Browsers consistently do this, we were preventing it. This fixes the
behavior of CheckboxInputWidget and RadioInputWidget when the label is
clicked.
Change-Id: I7e4f35f5e8b1d336b34ca2ae3d7f86cfadb3620c
---
M src/widgets/InputWidget.js
1 file changed, 3 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/99/193099/1
diff --git a/src/widgets/InputWidget.js b/src/widgets/InputWidget.js
index acf9ed2..a05a70f 100644
--- a/src/widgets/InputWidget.js
+++ b/src/widgets/InputWidget.js
@@ -158,9 +158,10 @@
*/
OO.ui.InputWidget.prototype.simulateLabelClick = function () {
if ( !this.isDisabled() ) {
- if ( this.$input.is( ':checkbox,:radio' ) ) {
+ if ( this.$input.is( ':checkbox, :radio' ) ) {
this.$input.click();
- } else if ( this.$input.is( ':input' ) ) {
+ }
+ if ( this.$input.is( ':input' ) ) {
this.$input[ 0 ].focus();
}
}
--
To view, visit https://gerrit.wikimedia.org/r/193099
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e4f35f5e8b1d336b34ca2ae3d7f86cfadb3620c
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz Dziewoński <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits