diff --git a/CHANGELOG.md b/CHANGELOG.md index f305979e..dab1e4e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/app.rs b/src/app.rs index fa9a928c..2f732a4b 100644 --- a/src/app.rs +++ b/src/app.rs @@ -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; } } _ => {} diff --git a/src/widgets/process_table.rs b/src/widgets/process_table.rs index f353c99c..74bf0666 100644 --- a/src/widgets/process_table.rs +++ b/src/widgets/process_table.rs @@ -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(); }