diff --git a/tui/src/filter.rs b/tui/src/filter.rs index 984d5d68..20192b03 100644 --- a/tui/src/filter.rs +++ b/tui/src/filter.rs @@ -164,4 +164,8 @@ impl Filter { self.search_input.remove(current); } } + pub fn clear_search(&mut self) { + self.search_input.clear(); + self.input_position = 0; + } } diff --git a/tui/src/state.rs b/tui/src/state.rs index d0c548bf..0f0b6fe5 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -783,6 +783,7 @@ impl AppState { 0usize, )]; self.selection.select(Some(0)); + self.filter.clear_search(); self.update_items(); }