fix: reset focus when opening a new tab

This commit is contained in:
Ashley Wulber 2026-04-06 20:33:43 -04:00 • committed by Jacob Kauffmann
parent d38d55525b
commit 9547da2b25

View file

@ -32,7 +32,8 @@ use cosmic::{
widget::scrollable, widget::scrollable,
window::{self, Event as WindowEvent, Id as WindowId}, window::{self, Event as WindowEvent, Id as WindowId},
}, },
iced_runtime::clipboard, iced_core::widget::operation::focusable::unfocus,
iced_runtime::{clipboard, task},
iced_widget::{button::focus, scrollable::AbsoluteOffset}, iced_widget::{button::focus, scrollable::AbsoluteOffset},
style, surface, theme, style, surface, theme,
widget::{ widget::{
@ -1177,14 +1178,14 @@ impl App {
entity.id() entity.id()
}; };
( let mut tasks = Vec::with_capacity(4);
entity, if activate {
Task::batch([ tasks.push(task::widget(unfocus()));
self.update_title(), }
self.update_watcher(), tasks.push(self.update_title());
self.update_tab(entity, location, selection_paths), tasks.push(self.update_watcher());
]), tasks.push(self.update_tab(entity, location, selection_paths));
) (entity, Task::batch(tasks))
} }
fn open_tab( fn open_tab(