Update todos example to select_all input on edit

This commit is contained in:
Cory Forsstrom 2022-11-11 09:08:52 -08:00
parent c4bca3f2af
commit a7a4a92466

View file

@ -131,7 +131,11 @@ impl Application for Todos {
task.update(task_message);
if should_focus {
text_input::focus(Task::text_input_id(i))
let id = Task::text_input_id(i);
Command::batch(vec![
text_input::focus(id.clone()),
text_input::select_all(id),
])
} else {
Command::none()
}