input: Fix Input to unselect on blur. (#1303)

This commit is contained in:
Jason Lee 2025-09-29 17:29:11 +08:00 committed by GitHub
parent 5e504d10bb
commit aca03d47c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2058,10 +2058,14 @@ impl InputState {
}
fn on_blur(&mut self, window: &mut Window, cx: &mut Context<Self>) {
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<Self>) {