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

Change subject: NumberInputWidget: Disable onWheel action unless the widget has 
focus
......................................................................


NumberInputWidget: Disable onWheel action unless the widget has focus

The scroll wheel handling has been annoying me for a long time, it's
very easy to trigger this by accident when scrolling through a form.
I've just realized that Chrome's <input type=number> also has this
feature, but it only kicks in when the field has focus, which seems
like a much better idea.

Change-Id: I6c9f4679dded73da64aeaa91238251a9aee5b40b
---
M src/widgets/NumberInputWidget.js
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/widgets/NumberInputWidget.js b/src/widgets/NumberInputWidget.js
index 284e975..2ce18c5 100644
--- a/src/widgets/NumberInputWidget.js
+++ b/src/widgets/NumberInputWidget.js
@@ -300,7 +300,7 @@
 OO.ui.NumberInputWidget.prototype.onWheel = function ( event ) {
        var delta = 0;
 
-       if ( !this.isDisabled() ) {
+       if ( !this.isDisabled() && this.input.$input.is( ':focus' ) ) {
                // Standard 'wheel' event
                if ( event.originalEvent.deltaMode !== undefined ) {
                        this.sawWheelEvent = true;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6c9f4679dded73da64aeaa91238251a9aee5b40b
Gerrit-PatchSet: 1
Gerrit-Project: oojs/ui
Gerrit-Branch: master
Gerrit-Owner: Bartosz DziewoƄski <[email protected]>
Gerrit-Reviewer: Anomie <[email protected]>
Gerrit-Reviewer: Prtksxna <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to