bug: fix close logic when pressing enter in sort menu (#2191)

There was an if-condition that only ran if the sort state was false. But this would never be hit since `use_sort_table_value` always set it to false beforehand, so it would be stuck focusing on a hidden menu.
This commit is contained in:
Clement Tsang
2026-08-13 00:40:41 +00:00
committed by GitHub
parent 2b3a5acb37
commit 726f787b89
3 changed files with 9 additions and 6 deletions
+6
View File
@@ -20,6 +20,12 @@ That said, these are more guidelines rather than hard rules, though the project
---
## 0.14.8/0.15.0 - Unreleased
### Bug Fixes
- [2191](https://github.com/ClementTsang/bottom/pull/2191): Fix close logic when pressing enter in sort menu.
## 0.14.7 - 2026-07-27
### Features
+3 -5
View File
@@ -512,13 +512,11 @@ impl App {
.states
.proc_state
.get_mut_widget_state(self.current_widget.widget_id - 2)
&& proc_widget_state.is_sort_open
{
proc_widget_state.use_sort_table_value();
if proc_widget_state.is_sort_open {
proc_widget_state.is_sort_open = false;
self.move_widget_selection(&WidgetDirection::Right);
self.is_force_redraw = true;
}
self.move_widget_selection(&WidgetDirection::Right);
self.is_force_redraw = true;
}
}
_ => {}
-1
View File
@@ -1130,7 +1130,6 @@ impl ProcWidgetState {
/// sort table if possible, then closes the sort table.
pub(crate) fn use_sort_table_value(&mut self) {
self.table.set_sort_index(self.sort_table.current_index());
self.is_sort_open = false;
self.force_rerender_and_update();
}