Skip to content

Commit c955415

Browse files
committed
Deeclare event listeners as non-passive to remove Chrome browser warnings
1 parent a62f1aa commit c955415

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/calm-pianos-joke.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'react-select': patch
3+
---
4+
5+
Set event listeners to be non-passive to remove Chrome console warnings

packages/react-select/src/internal/useScrollCapture.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ export default function useScrollCapture({
103103

104104
// all the if statements are to appease Flow 😢
105105
if (typeof el.addEventListener === 'function') {
106-
el.addEventListener('wheel', onWheel, false);
106+
el.addEventListener('wheel', onWheel, { passive: false });
107107
}
108108
if (typeof el.addEventListener === 'function') {
109-
el.addEventListener('touchstart', onTouchStart, false);
109+
el.addEventListener('touchstart', onTouchStart, { passive: false });
110110
}
111111
if (typeof el.addEventListener === 'function') {
112-
el.addEventListener('touchmove', onTouchMove, false);
112+
el.addEventListener('touchmove', onTouchMove, { passive: false });
113113
}
114114
},
115115
[onTouchMove, onTouchStart, onWheel]

0 commit comments

Comments
 (0)