chore: clean up zoom example
@@ -14,10 +14,11 @@ fn app(cx: Scope) -> Element {
r#type: "number",
value: "{level}",
oninput: |e| {
- let new_zoom = e.value.parse::<f64>().unwrap_or(1.0);
+ if let Ok(new_zoom) = e.value.parse::<f64>() {
level.set(new_zoom);
window.webview.zoom(new_zoom);
}
}
+ }
})
}
