mirror of
https://github.com/ClementTsang/bottom.git
synced 2026-08-23 03:46:29 +00:00
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:
@@ -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
@@ -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;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user