Last active
August 29, 2015 14:21
-
-
Save ryanhamley/36e2d072d4be9cf191d1 to your computer and use it in GitHub Desktop.
An Angular directive for use with number inputs to prevent mousewheel events from changing the input.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('myApp') | |
.directive('ignoreMouseWheel', function () { | |
return { | |
restrict: 'A', | |
link: function (scope, element) { | |
element.bind('mousewheel', function() { | |
element[0].blur(); | |
}); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment