New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
VirtualizedList
passive event listener warning
#2598
Labels
Comments
57 tasks
tienifr
changed the title
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event
Oct 25, 2023
VirtualizedList
passive event listener warning
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: