From 05410db4e50e2cbbee84e6b2947a9e2a8a17a353 Mon Sep 17 00:00:00 2001 From: Ana Margarida Silva Date: Tue, 21 Mar 2023 13:00:36 +0000 Subject: [PATCH] fix: add scroll wheel sensitivity to reduce the speed of the scroll --- .../src/vendor/react-native/VirtualizedList/index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js b/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js index 1cc5858dc5..5cc7f3f939 100644 --- a/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js +++ b/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js @@ -47,6 +47,8 @@ type Item = any; const __DEV__ = process.env.NODE_ENV !== 'production'; +const SCROLL_WHEEL_SENSITIVITY = 0.5; + export type Separators = { highlight: () => void, unhighlight: () => void, @@ -817,7 +819,7 @@ class VirtualizedList extends React.PureComponent { const delta = this.props.horizontal ? ev.deltaX || ev.wheelDeltaX : ev.deltaY || ev.wheelDeltaY; - let leftoverDelta = delta; + let leftoverDelta = delta * SCROLL_WHEEL_SENSITIVITY; if (isEventTargetScrollable) { leftoverDelta = delta < 0 ? Math.min(delta + scrollOffset, 0)