From 8994775be2c3e840af647ad87c2c6e5a1c854d5a Mon Sep 17 00:00:00 2001 From: ardocrat Date: Fri, 30 May 2025 15:06:47 +0300 Subject: [PATCH] fix: keyboard focus --- src/gui/app.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/app.rs b/src/gui/app.rs index 9e3ca8fd..2151fcaa 100755 --- a/src/gui/app.rs +++ b/src/gui/app.rs @@ -129,17 +129,17 @@ impl App { self.platform.clear_user_attention(); } - // Show modal or keyboard window above others. + // Show modal or keyboard window above opened Modal. if Modal::opened().is_some() { ctx.move_to_top(LayerId::new(Order::Middle, egui::Id::new(Modal::WINDOW_ID))); - } - let keyboard_showing = if let Some(l) = ctx.top_layer_id() { - l.id == egui::Id::new(KeyboardContent::WINDOW_ID) - } else { - false - }; - if keyboard_showing { - ctx.move_to_top(LayerId::new(Order::Middle, egui::Id::new(KeyboardContent::WINDOW_ID))); + let keyboard_showing = if let Some(l) = ctx.top_layer_id() { + l.id == egui::Id::new(KeyboardContent::WINDOW_ID) + } else { + false + }; + if keyboard_showing { + ctx.move_to_top(LayerId::new(Order::Middle, egui::Id::new(KeyboardContent::WINDOW_ID))); + } } // Reset keyboard state for newly opened modal. if Modal::first_draw() {