I have script like this, It shows the message in console when wheel works with ctrlkey(for mac command key)
const handleWheel = (e) =>{
if (e.ctrlKey || e.metaKey){
console.log("handle wheel is called");
}
}
useEffect(() =>{
ref_wrapper_div.current.addEventListener('wheel',handleWheel,{passive:false});
});
Now something strange happens.
- command with mouse wheel -> message appears
- release the wheel -> nothing happens
- push command key -> message appears
why this 3 happens?
How can I prevent this?