Clear and close search field on nav

This commit is contained in:
Francesco Pio Gaglione 2024-08-10 21:54:19 +02:00
parent ca1168ddf5
commit b6a45e6f2b

View file

@ -1111,6 +1111,9 @@ impl Application for App {
}
fn on_nav_select(&mut self, entity: Entity) -> Command<Self::Message> {
self.search_active = false;
self.search_input.clear();
self.nav_model.activate(entity);
if let Some(location) = self.nav_model.data::<Location>(entity) {
let message = Message::TabMessage(None, tab::Message::Location(location.clone()));
@ -1122,7 +1125,6 @@ impl Application for App {
return mounter.mount(data.1.clone()).map(|_| message::none());
}
}
Command::none()
}