Skip to content

Commit d106480

Browse files
authored
fix: wheel handler set passive false
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
1 parent fe039bf commit d106480

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/List.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,9 @@ export function RawList<T>(props: ListProps<T>, ref: React.Ref<ListRef>) {
268268
}
269269
}
270270

271-
componentRef.current.addEventListener('wheel', onRawWheel);
271+
componentRef.current.addEventListener('wheel', onRawWheel, {
272+
passive: false,
273+
});
272274
componentRef.current.addEventListener('DOMMouseScroll', onFireFoxScroll as any);
273275
componentRef.current.addEventListener('MozMousePixelScroll', onMozMousePixelScroll);
274276

0 commit comments

Comments
 (0)