summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-11-11 09:08:52 -0800
committerLibravatar Cory Forsstrom <cforsstrom18@gmail.com>2022-11-11 09:08:52 -0800
commita7a4a92466a4447f8d2e9b5ae2fc715ba6262de0 (patch)
treec3dbfe3becd2b3d1e3cd9f2cc22598fb1fa22db8
parentc4bca3f2af7ae9b2c8dfc3af48ab73dad852ed34 (diff)
downloadiced-a7a4a92466a4447f8d2e9b5ae2fc715ba6262de0.tar.gz
iced-a7a4a92466a4447f8d2e9b5ae2fc715ba6262de0.tar.bz2
iced-a7a4a92466a4447f8d2e9b5ae2fc715ba6262de0.zip
Update todos example to select_all input on edit
-rw-r--r--examples/todos/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index be48ae8c..690d9c09 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -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()
}