Skip to content

Commit 52565e5

Browse files
nyxnyx
andauthored
clear the search bar if the user changes categories (#752)
Co-authored-by: nyx <nnyyxxxx@users.noreply.github.com>
1 parent 9353849 commit 52565e5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

tui/src/filter.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,4 +164,8 @@ impl Filter {
164164
self.search_input.remove(current);
165165
}
166166
}
167+
pub fn clear_search(&mut self) {
168+
self.search_input.clear();
169+
self.input_position = 0;
170+
}
167171
}

tui/src/state.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,7 @@ impl AppState {
783783
0usize,
784784
)];
785785
self.selection.select(Some(0));
786+
self.filter.clear_search();
786787
self.update_items();
787788
}
788789

0 commit comments

Comments
 (0)