From 39dc4b9040affb964b8405bbf1303c4ade60a2d7 Mon Sep 17 00:00:00 2001 From: Kirill Bulatov Date: Tue, 24 Jun 2025 19:11:25 +0300 Subject: [PATCH] Fix being unable to input a whitespace character in collab channels filter (#33318) Before, `space` was always causing a channel join. Now it's less fluent, one has to press `ESC` to get the focus out of the filter editor and then `space` starts joining the channel. Release Notes: - Fixed being unable to input a whitespace character in collab channels filter --- crates/collab_ui/src/collab_panel.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/collab_ui/src/collab_panel.rs b/crates/collab_ui/src/collab_panel.rs index d45ce2f88dc5579fcb410180363b855d4b999fa3..6501d3a56649ec3cb2ef15099829d601fbbfadd4 100644 --- a/crates/collab_ui/src/collab_panel.rs +++ b/crates/collab_ui/src/collab_panel.rs @@ -1645,6 +1645,10 @@ impl CollabPanel { self.channel_name_editor.update(cx, |editor, cx| { editor.insert(" ", window, cx); }); + } else if self.filter_editor.focus_handle(cx).is_focused(window) { + self.filter_editor.update(cx, |editor, cx| { + editor.insert(" ", window, cx); + }); } } @@ -2045,7 +2049,9 @@ impl CollabPanel { dispatch_context.add("CollabPanel"); dispatch_context.add("menu"); - let identifier = if self.channel_name_editor.focus_handle(cx).is_focused(window) { + let identifier = if self.channel_name_editor.focus_handle(cx).is_focused(window) + || self.filter_editor.focus_handle(cx).is_focused(window) + { "editing" } else { "not_editing" @@ -3031,7 +3037,7 @@ impl Render for CollabPanel { .on_action(cx.listener(CollabPanel::start_move_selected_channel)) .on_action(cx.listener(CollabPanel::move_channel_up)) .on_action(cx.listener(CollabPanel::move_channel_down)) - .track_focus(&self.focus_handle(cx)) + .track_focus(&self.focus_handle) .size_full() .child(if self.user_store.read(cx).current_user().is_none() { self.render_signed_out(cx)