Skip to content

Commit

Permalink
Merge pull request #19 from Araxeus/fix-input-onwheel-firing-only-whe…
Browse files Browse the repository at this point in the history
…n-focused
  • Loading branch information
Araxeus authored Mar 16, 2023
2 parents 87c3228 + 8dc169d commit 742b555
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/page/prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,10 @@ function promptCreateInput(options) {
}

if (dataElement.getAttribute('type') === 'number') {
// somehow this is needed to activate wheel events on number inputs
dataElement.onwheel = () => {};
dataElement.onwheel = (event) => {
event.preventDefault();
event.deltaY < 0 ? dataElement.stepUp() : dataElement.stepDown();
};
}

//Cancel/Exit on 'Escape'
Expand Down

0 comments on commit 742b555

Please sign in to comment.