Remove unnecessary preventDefault() calls
This commit is contained in:
parent
0786d534f4
commit
d3aeff8838
3 changed files with 1 additions and 16 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue