Remove redundant set_value in todomvc example (#530)

This commit is contained in:
Artem Makoven 2022-11-24 21:12:13 +09:00 committed by GitHub
parent 568b5b13c8
commit a770858ec5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 7 deletions

View File

@ -254,13 +254,7 @@ pub fn Item<G: Html>(cx: Scope, todo: RcSignal<Todo>) -> View<G> {
let event: KeyboardEvent = event.unchecked_into(); let event: KeyboardEvent = event.unchecked_into();
match event.key().as_str() { match event.key().as_str() {
"Enter" => handle_blur(), "Enter" => handle_blur(),
"Escape" => { "Escape" => is_editing.set(false),
input_ref
.get::<DomNode>()
.unchecked_into::<HtmlInputElement>()
.set_value(&title());
is_editing.set(false);
}
_ => {} _ => {}
} }
}; };