fix: panel is not focus

This commit is contained in:
2025-02-06 09:11:44 +07:00
parent a941e844b9
commit 193aaa646e
6 changed files with 21 additions and 60 deletions

View File

@@ -171,6 +171,7 @@ impl TabPanel {
fn set_active_ix(&mut self, ix: usize, window: &mut Window, cx: &mut Context<Self>) {
if ix == self.active_ix {
self.focus_active_panel(window, cx);
return;
}
@@ -1021,7 +1022,7 @@ impl TabPanel {
fn focus_active_panel(&self, window: &mut Window, cx: &mut Context<Self>) {
if let Some(active_panel) = self.active_panel(cx) {
active_panel.focus_handle(cx).focus(window);
window.focus(&active_panel.focus_handle(cx));
}
}