chore: clean up zoom example

This commit is contained in:
Jonathan Kelley 2022-12-30 02:32:53 -05:00
parent a13b69788b
commit 972084ee32

View file

@ -14,9 +14,10 @@ fn app(cx: Scope) -> Element {
r#type: "number", r#type: "number",
value: "{level}", value: "{level}",
oninput: |e| { 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); level.set(new_zoom);
window.webview.zoom(new_zoom); window.webview.zoom(new_zoom);
}
} }
} }
}) })