summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
authorLibravatar Aldo Fregoso <aldomx@gmail.com>2021-03-13 14:50:59 -0600
committerLibravatar Aldo Fregoso <aldomx@gmail.com>2021-03-13 14:50:59 -0600
commit57247106b95acb120381305cbe1ab4077b17651f (patch)
treee93339c25ae8a11253b54eaa34b12dbe49759e41 /examples/todos
parentc1f70f1e9252b1971c17cd385273460c669fac26 (diff)
downloadiced-57247106b95acb120381305cbe1ab4077b17651f.tar.gz
iced-57247106b95acb120381305cbe1ab4077b17651f.tar.bz2
iced-57247106b95acb120381305cbe1ab4077b17651f.zip
Added `select_all` method to `TextInput`.
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/src/main.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index 7186b950..ee0022d5 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -265,8 +265,10 @@ impl Task {
self.completed = completed;
}
TaskMessage::Edit => {
+ let mut text_input = text_input::State::focused();
+ text_input.select_all();
self.state = TaskState::Editing {
- text_input: text_input::State::focused(),
+ text_input,
delete_button: button::State::new(),
};
}