Bartosz Dziewoński has uploaded a new change for review.
https://gerrit.wikimedia.org/r/283200
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(-)
git pull ssh://gerrit.wikimedia.org:29418/oojs/ui refs/changes/00/283200/1
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: newchange
Gerrit-Change-Id: I6c9f4679dded73da64aeaa91238251a9aee5b40b
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