feat(example:todomvc): add editing support

- implement "onfocusout" handler
- set autofocus
- handle enter, escape and tab on a todo item
- make the `<pre>` element between todo list items of margin 0 to be unnoticable
This commit is contained in:
Sven Assmann committed 2022-01-10 14:46:23 +01:00
1 parent 02d995e3f7
commit 9849f68f25
5 files changed
+27 -10

No files matched your search

+2 -1
View File
@@ -52,7 +52,7 @@ fn make_synthetic_event(name: &str, val: serde_json::Value) -> Arc<dyn Any + Sen
let evt = serde_json::from_value::<KeyboardData>(val).unwrap();
Arc::new(evt)
}
"focus" | "blur" => {
"focus" | "blur" | "focusout" => {
//
Arc::new(FocusData {})
}
@@ -117,6 +117,7 @@ fn event_name_from_typ(typ: &str) -> &'static str {
"keypress" => "keypress",
"keyup" => "keyup",
"focus" => "focus",
"focusout" => "focusout",
"blur" => "blur",
"change" => "change",
"input" => "input",