clear the search bar if the user changes categories (#752)

Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
This commit is contained in:
nyx 2024-10-31 14:41:03 -04:00 committed by GitHub
parent 9353849e16
commit 52565e5ea1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -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;
}
}

View File

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