Merge pull request #4930 from mabashian/4889-number-input-scroll

Prevent usage of mousewheel on spinner elements

Reviewed-by: https://github.com/apps/softwarefactory-project-zuul
This commit is contained in:
softwarefactory-project-zuul[bot]
2019-10-08 14:25:07 +00:00
committed by GitHub

View File

@@ -1059,6 +1059,9 @@ function(SettingsUtils, i18n, $rootScope) {
up: "Form-numberInputButton fa fa-angle-up" up: "Form-numberInputButton fa fa-angle-up"
}, },
spin: function(e, u) { spin: function(e, u) {
if (e.originalEvent && e.originalEvent.type === 'mousewheel') {
e.preventDefault();
} else {
ctrl.$setViewValue(u.value); ctrl.$setViewValue(u.value);
ctrl.$setValidity('required', true); ctrl.$setValidity('required', true);
ctrl.$setValidity('min', true); ctrl.$setValidity('min', true);
@@ -1073,6 +1076,7 @@ function(SettingsUtils, i18n, $rootScope) {
scope.$digest(); scope.$digest();
} }
} }
}
}; };
// hack to get ngDisabled to work // hack to get ngDisabled to work