Skip to content

Commit 98821c4

Browse files
author
mc1098
authored
Fix default passive option (yewstack#2111)
1 parent 05728e1 commit 98821c4

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

packages/yew/src/virtual_dom/listeners.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,8 @@ impl GlobalHandlers {
358358
&{
359359
let mut opts = web_sys::AddEventListenerOptions::new();
360360
opts.capture(true);
361-
if desc.passive {
362-
opts.passive(true);
363-
}
361+
// We need to explicitly set passive to override any browser defaults
362+
opts.passive(desc.passive);
364363
opts
365364
},
366365
)

0 commit comments

Comments
 (0)