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 4e398ee7..fc3a2e31 100644 --- a/tui/src/state.rs +++ b/tui/src/state.rs @@ -729,6 +729,7 @@ impl AppState { .root() .id()]; self.selection.select(Some(0)); + self.filter.clear_search(); self.update_items(); }