mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-11 05:21:31 +11:00
Resume propagation of events
This commit is contained in:
parent
ab4a4a89e6
commit
fc046add78
|
@ -378,16 +378,10 @@ impl Common {
|
||||||
E: 'static + AsRef<web_sys::Event> + wasm_bindgen::convert::FromWasmAbi,
|
E: 'static + AsRef<web_sys::Event> + wasm_bindgen::convert::FromWasmAbi,
|
||||||
F: 'static + FnMut(E),
|
F: 'static + FnMut(E),
|
||||||
{
|
{
|
||||||
let closure = Closure::wrap(Box::new(move |event: E| {
|
let closure = Closure::new(move |event: E| {
|
||||||
{
|
event.as_ref().stop_propagation();
|
||||||
let event_ref = event.as_ref();
|
|
||||||
event_ref.stop_propagation();
|
|
||||||
event_ref.cancel_bubble();
|
|
||||||
}
|
|
||||||
|
|
||||||
handler(event);
|
handler(event);
|
||||||
}) as Box<dyn FnMut(E)>);
|
});
|
||||||
|
|
||||||
EventListenerHandle::new(&self.raw, event_name, closure)
|
EventListenerHandle::new(&self.raw, event_name, closure)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue