Skip to content

Commit

Permalink
feat: clear filter now always preserve the current focus
Browse files Browse the repository at this point in the history
fixes #78
  • Loading branch information
cablehead committed Jun 13, 2024
1 parent 12b37f5 commit 2ab86c3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src-tauri/src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,11 @@ impl UI {
let matches = store.query(filter, content_type);
Some(matches)
} else {
// preserve current focus when clearing the filter
self.select(self.view.get_best_focus(&self.focused));
None
};
self.refresh_view(v);
if !filter.is_empty() || (content_type != "All" && !content_type.is_empty()) {
self.select(self.view.get_best_focus(&None));
}
}

pub fn refresh_view(&mut self, v: &view::View) {
Expand Down

0 comments on commit 2ab86c3

Please sign in to comment.