summaryrefslogtreecommitdiffstats
path: root/examples/todos
diff options
context:
space:
mode:
Diffstat (limited to 'examples/todos')
-rw-r--r--examples/todos/Cargo.toml1
-rw-r--r--examples/todos/src/main.rs7
2 files changed, 2 insertions, 6 deletions
diff --git a/examples/todos/Cargo.toml b/examples/todos/Cargo.toml
index 3c62bfbc..0d72be86 100644
--- a/examples/todos/Cargo.toml
+++ b/examples/todos/Cargo.toml
@@ -9,7 +9,6 @@ publish = false
iced.workspace = true
iced.features = ["async-std", "debug"]
-once_cell.workspace = true
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
uuid = { version = "1.0", features = ["v4", "fast-rng", "serde"] }
diff --git a/examples/todos/src/main.rs b/examples/todos/src/main.rs
index a5f7b36a..25e3ead2 100644
--- a/examples/todos/src/main.rs
+++ b/examples/todos/src/main.rs
@@ -6,12 +6,9 @@ use iced::widget::{
use iced::window;
use iced::{Center, Element, Fill, Font, Subscription, Task as Command};
-use once_cell::sync::Lazy;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
-static INPUT_ID: Lazy<text_input::Id> = Lazy::new(text_input::Id::unique);
-
pub fn main() -> iced::Result {
#[cfg(not(target_arch = "wasm32"))]
tracing_subscriber::fmt::init();
@@ -85,7 +82,7 @@ impl Todos {
_ => {}
}
- text_input::focus(INPUT_ID.clone())
+ text_input::focus("new-task")
}
Todos::Loaded(state) => {
let mut saved = false;
@@ -198,7 +195,7 @@ impl Todos {
.align_x(Center);
let input = text_input("What needs to be done?", input_value)
- .id(INPUT_ID.clone())
+ .id("new-task")
.on_input(Message::InputChanged)
.on_submit(Message::CreateTask)
.padding(15)