Focus toggled elements when interacting with the sidebars
Also, restore focus on the workspace when there is no active item on the sidebar that was just toggled.
This commit is contained in:
parent
1489c865e7
commit
386631debf
4 changed files with 16 additions and 1 deletions
|
@ -767,6 +767,11 @@ impl Workspace {
|
|||
Side::Right => &mut self.right_sidebar,
|
||||
};
|
||||
sidebar.toggle_item(action.0.item_index);
|
||||
if let Some(active_item) = sidebar.active_item() {
|
||||
cx.focus(active_item);
|
||||
} else {
|
||||
cx.focus_self();
|
||||
}
|
||||
cx.notify();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue