summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/websocket/src/main.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/examples/websocket/src/main.rs b/examples/websocket/src/main.rs
index e7ececf7..ba1e1029 100644
--- a/examples/websocket/src/main.rs
+++ b/examples/websocket/src/main.rs
@@ -1,7 +1,9 @@
mod echo;
use iced::alignment::{self, Alignment};
-use iced::widget::{button, center, column, row, scrollable, text, text_input};
+use iced::widget::{
+ self, button, center, column, row, scrollable, text, text_input,
+};
use iced::{color, Command, Element, Length, Subscription};
use once_cell::sync::Lazy;
@@ -29,7 +31,10 @@ enum Message {
impl WebSocket {
fn load() -> Command<Message> {
- Command::perform(echo::server::run(), |_| Message::Server)
+ Command::batch([
+ Command::perform(echo::server::run(), |_| Message::Server),
+ widget::focus_next(),
+ ])
}
fn update(&mut self, message: Message) -> Command<Message> {