From aca03d47c03aead8d30d398d1c437f720811ae2e Mon Sep 17 00:00:00 2001 From: Jason Lee Date: Mon, 29 Sep 2025 17:29:11 +0800 Subject: [PATCH] input: Fix Input to unselect on blur. (#1303) --- crates/ui/src/input/state.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/ui/src/input/state.rs b/crates/ui/src/input/state.rs index 952d6643..02d9f682 100644 --- a/crates/ui/src/input/state.rs +++ b/crates/ui/src/input/state.rs @@ -2058,10 +2058,14 @@ impl InputState { } fn on_blur(&mut self, window: &mut Window, cx: &mut Context) { - if !self.is_context_menu_open(cx) { + if self.is_context_menu_open(cx) { return; } + self.hover_popover = None; + self.diagnostic_popover = None; + self.context_menu = None; + self.unselect(window, cx); self.blink_cursor.update(cx, |cursor, cx| { cursor.stop(cx); }); @@ -2069,6 +2073,7 @@ impl InputState { root.focused_input = None; }); cx.emit(InputEvent::Blur); + cx.notify(); } fn pause_blink_cursor(&mut self, cx: &mut Context) {