-
Notifications
You must be signed in to change notification settings - Fork 155
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: wheel handler set passive false #97
base: master
Are you sure you want to change the base?
Conversation
List.js:248 [Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952 when use preventDefault in wheel event handler, should set passive false
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/virtual-list/h2dfum9mm |
Codecov Report
@@ Coverage Diff @@
## master #97 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 470 470
Branches 89 89
=========================================
Hits 470 470
Continue to review full report at Codecov.
|
componentRef.current.addEventListener('wheel', onRawWheel, {
passive: true,
}); 我看内部使用了 Emmm...不知道有没有其他方案。 |
passive: true 是默认值吧,如果内部想要调用 |
要看是什么事件, |
这警告不是由于 相当于是 Chrome 的一个建议,非被动的(non-passive)的事件监听可能会阻塞页面响应。 |
List.js:248
[Violation] Added non-passive event listener to a scroll-blocking 'wheel' event. Consider marking event handler as 'passive' to make the page more responsive. See https://www.chromestatus.com/feature/5745543795965952
when use preventDefault in wheel event handler, should set passive false