Skip to content

Commit

Permalink
addEventListener('wheel', onWheel) add { passive: false } (#618)
Browse files Browse the repository at this point in the history
  • Loading branch information
puxiao authored Jan 20, 2024
1 parent 26ca77b commit 3323fbb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ const InternalInputNumber = React.forwardRef(
// React onWheel is passive and we can't preventDefault() in it.
// That's why we should subscribe with DOM listener
// https://stackoverflow.com/questions/63663025/react-onwheel-handler-cant-preventdefault-because-its-a-passive-event-listenev
input.addEventListener('wheel', onWheel);
input.addEventListener('wheel', onWheel, { passive: false });
return () => input.removeEventListener('wheel', onWheel);
}
}, [onInternalStep]);
Expand Down

1 comment on commit 3323fbb

@vercel
Copy link

@vercel vercel bot commented on 3323fbb Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.