Remove unnecessary preventDefault() calls

This commit is contained in:
dAxpeDDa 2023-06-04 12:46:03 +02:00 committed by daxpedda
parent 0786d534f4
commit d3aeff8838
3 changed files with 1 additions and 16 deletions

View file

@ -91,7 +91,6 @@ impl<T> EventLoopWindowTarget<T> {
canvas.set_attribute("data-raw-handle", &id.0.to_string()); canvas.set_attribute("data-raw-handle", &id.0.to_string());
canvas.on_touch_start(prevent_default); canvas.on_touch_start(prevent_default);
canvas.on_touch_end(prevent_default);
let runner = self.runner.clone(); let runner = self.runner.clone();
let has_focus_clone = has_focus.clone(); let has_focus_clone = has_focus.clone();

View file

@ -138,14 +138,6 @@ impl Canvas {
})); }));
} }
pub fn on_touch_end(&mut self, prevent_default: bool) {
self.on_touch_end = Some(self.common.add_event("touchend", move |event: Event| {
if prevent_default {
event.prevent_default();
}
}));
}
pub fn on_blur<F>(&mut self, mut handler: F) pub fn on_blur<F>(&mut self, mut handler: F)
where where
F: 'static + FnMut(), F: 'static + FnMut(),

View file

@ -203,13 +203,7 @@ impl PointerHandler {
let pointer_type = event.pointer_type(); let pointer_type = event.pointer_type();
match pointer_type.as_str() { match pointer_type.as_str() {
"touch" => { "touch" | "mouse" => (),
if prevent_default {
// prevent scroll on mobile web
event.prevent_default();
}
}
"mouse" => (),
_ => return, _ => return,
} }