From 76703cebf3cba8b134b6ab6c0b76e8c84ecfebca Mon Sep 17 00:00:00 2001 From: cha0s Date: Mon, 11 Apr 2022 11:39:25 -0500 Subject: [PATCH] chore: non-passive --- packages/input/src/client/normalizer.js | 4 ++-- packages/react/src/components/number/index.jsx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/input/src/client/normalizer.js b/packages/input/src/client/normalizer.js index c0e8453..b75a3d0 100644 --- a/packages/input/src/client/normalizer.js +++ b/packages/input/src/client/normalizer.js @@ -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; } diff --git a/packages/react/src/components/number/index.jsx b/packages/react/src/components/number/index.jsx index 9428fc5..dd4694f 100644 --- a/packages/react/src/components/number/index.jsx +++ b/packages/react/src/components/number/index.jsx @@ -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