Merge pull request #349 from francesco-gaglione/master

Clear and close search field on nav buttons clicked
This commit is contained in:
Jeremy Soller 2024-08-10 16:06:34 -06:00 committed by GitHub
commit ba0adf6600
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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()
}