Skip to content

Instantly share code, notes, and snippets.

@philecker
Last active August 23, 2021 00:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philecker/3ed5c3a5effaf0ace083d90d90a6d021 to your computer and use it in GitHub Desktop.
Save philecker/3ed5c3a5effaf0ace083d90d90a6d021 to your computer and use it in GitHub Desktop.
document.addEventListener('wheel', () => {
if(document.activeElement.type === 'number'){
document.activeElement.blur();
}
});
@philecker
Copy link
Author

Simple event listener to prevent mouse wheel from incrementing number input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment