chore: non-passive

This commit is contained in:
cha0s 2022-04-11 11:39:25 -05:00
parent 92a451419b
commit 76703cebf3
2 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ export default class InputNormalizer extends decorate(Class) {
this.target.addEventListener('touchmove', this.onTouchMove);
window.addEventListener('touchend', this.onTouchEnd);
}
this.target.addEventListener('wheel', this.onWheel);
this.target.addEventListener('wheel', this.onWheel, {passive: false});
}
onAxisChange({index, value}) {
@ -205,7 +205,7 @@ export default class InputNormalizer extends decorate(Class) {
this.target.removeEventListener('touchmove', this.onTouchMove);
window.removeEventListener('touchend', this.onTouchEnd);
}
this.target.removeEventListener('wheel', this.onWheel);
this.target.removeEventListener('wheel', this.onWheel, {passive: false});
this.target = undefined;
this.targetForKeyUp = undefined;
}

View File

@ -44,9 +44,9 @@ const Number = ({
return undefined;
}
const input = inputRef.current;
input.addEventListener('wheel', onWheel);
input.addEventListener('wheel', onWheel, {passive: false});
return () => {
input.removeEventListener('wheel', onWheel);
input.removeEventListener('wheel', onWheel, {passive: false});
};
});
// eslint-disable-next-line no-param-reassign