mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 22:01:31 +11:00
Remove unnecessary preventDefault()
calls
This commit is contained in:
parent
0786d534f4
commit
d3aeff8838
|
@ -91,7 +91,6 @@ impl<T> EventLoopWindowTarget<T> {
|
|||
canvas.set_attribute("data-raw-handle", &id.0.to_string());
|
||||
|
||||
canvas.on_touch_start(prevent_default);
|
||||
canvas.on_touch_end(prevent_default);
|
||||
|
||||
let runner = self.runner.clone();
|
||||
let has_focus_clone = has_focus.clone();
|
||||
|
|
|
@ -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)
|
||||
where
|
||||
F: 'static + FnMut(),
|
||||
|
|
|
@ -203,13 +203,7 @@ impl PointerHandler {
|
|||
let pointer_type = event.pointer_type();
|
||||
|
||||
match pointer_type.as_str() {
|
||||
"touch" => {
|
||||
if prevent_default {
|
||||
// prevent scroll on mobile web
|
||||
event.prevent_default();
|
||||
}
|
||||
}
|
||||
"mouse" => (),
|
||||
"touch" | "mouse" => (),
|
||||
_ => return,
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue