Skip to content

Commit

Permalink
Merge pull request #168 from ahmed-deriv/ahmed/DAPI-811/fix--markup-p…
Browse files Browse the repository at this point in the history
…ercentage-on-scroll

ahmed/DAPI-811/fix--markup-percentage-on-scroll
  • Loading branch information
sandeep-deriv authored Nov 8, 2024
2 parents b83a5a9 + b5b0baa commit bd1ae0d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ const StepperTextField: React.FC<StepperTextFieldProps> = ({
const { register, watch } = useFormContext();
const value = watch(name);

const handleWheel = (event: WheelEvent) => {
event.preventDefault();
};

React.useEffect(() => {
const input = document.querySelector('.stepper_text_field');
if (input) {
input.addEventListener('wheel', handleWheel, { passive: false });
}
return () => {
if (input) {
input.removeEventListener('wheel', handleWheel);
}
};
}, []);

return (
<div className='stepper_text_field'>
<div className='stepper_text_field__main'>
Expand Down

0 comments on commit bd1ae0d

Please sign in to comment.