Skip to content

Commit

Permalink
Resume propagation of events
Browse files Browse the repository at this point in the history
  • Loading branch information
daxpedda committed Jun 11, 2023
1 parent ab4a4a8 commit fc046ad
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/platform_impl/web/web_sys/canvas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,16 +378,10 @@ impl Common {
E: 'static + AsRef<web_sys::Event> + wasm_bindgen::convert::FromWasmAbi,
F: 'static + FnMut(E),
{
let closure = Closure::wrap(Box::new(move |event: E| {
{
let event_ref = event.as_ref();
event_ref.stop_propagation();
event_ref.cancel_bubble();
}

let closure = Closure::new(move |event: E| {
event.as_ref().stop_propagation();
handler(event);
}) as Box<dyn FnMut(E)>);

});
EventListenerHandle::new(&self.raw, event_name, closure)
}

Expand Down

0 comments on commit fc046ad

Please sign in to comment.