clear the search bar if the user changes categories

This commit is contained in:
nyx 2024-10-03 22:59:35 -04:00
parent 3c4a5dcecd
commit 5386cb7f84
No known key found for this signature in database
GPG Key ID: 9924455A3BB7D06C
2 changed files with 5 additions and 0 deletions

View File

@ -158,4 +158,8 @@ impl Filter {
self.search_input.remove(current); self.search_input.remove(current);
} }
} }
pub fn clear_search(&mut self) {
self.search_input.clear();
self.input_position = 0;
}
} }

View File

@ -723,6 +723,7 @@ impl AppState {
.root() .root()
.id()]; .id()];
self.selection.select(Some(0)); self.selection.select(Some(0));
self.filter.clear_search();
self.update_items(); self.update_items();
} }