You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passive event warning [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event appears when using VirtualizedList. Happens on Chrome 51 or later which support passive event listener.
tienifr
changed the title
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' eventVirtualizedList passive event listener warning
Oct 25, 2023
Is there an existing issue for this?
Describe the issue
Passive event warning
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event
appears when usingVirtualizedList
. Happens on Chrome 51 or later which support passive event listener.Expected behavior
The passive event warning does not appear.
Steps to reproduce
VirtualizedList
componentTest case
https://codesandbox.io/s/summer-dew-txtgt2
Additional comments
Proposed solution
Root cause
We're not using
passive
options for performance improvement when adding listener for thewheel
event here:react-native-web/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js
Lines 748 to 750 in a3ea2a0
Solution
passive: true
towheel
event listener with passive event feature detection in order not to collide withcapture
optionpreventDefault
in the listener here:react-native-web/packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js
Line 484 in a3ea2a0
The text was updated successfully, but these errors were encountered: