-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix: VirtualizedList
passive event listener warning
#2601
Fix: VirtualizedList
passive event listener warning
#2601
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8caedca:
|
VirtualizedList
passive event listener warningVirtualizedList
passive event listener warning
packages/react-native-web/src/vendor/react-native/VirtualizedList/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only needs the options object, no need to export/import an internal helper.
Note that VirtualizedList
is no longer synced and maintained by RNfWeb. Expensify should contribute to getting the component exported as a package and work web-related features into the upstream source of truth facebook/react-native#35263
cc @Beamanator or @roryabraham on the above ^ as I see you are the maintainter of the RNW tracker. |
…into fix/added-non-passive-event-to-wheel-event
With this Fix they released they broke the VirtualizedList of react-native in react-native-web with the list inverted.
// REACT-NATIVE-WEB patch to preserve during future RN merges: Support inverted wheel scroller. to fix it:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not work in inverted list, need to passive false to work..
you can fix rhis?
setupWebWheelHandler() {
if (this._scrollRef && this._scrollRef.getScrollableNode && this._scrollRef.inverted) {
this._scrollRef.getScrollableNode().addEventListener('wheel',
this.invertedWheelEventHandler,
);
} else {
setTimeout(() => this.setupWebWheelHandler(), 50);
return
}
}
Details
Fixes #2598.
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. This PR eliminates the warning by adding passive event listener support forVitualizedList
.Tests
VirtualizedList
component