Merge pull request #3063 from edwloef/combo-box-click-fix

Fix `combo_box` text not getting cleared on selection
This commit is contained in:
Héctor 2025-11-29 14:44:23 +01:00 committed by GitHub
commit 9e1340f36f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -897,14 +897,18 @@ where
menu,
&filtered_options.options,
hovered_option,
|x| {
tree.children[0]
.state
.downcast_mut::<text_input::State<Renderer::Paragraph>>(
)
.unfocus();
|selection| {
self.state.with_inner_mut(|state| {
state.value = String::new();
state.filtered_options.update(self.state.options.clone());
});
(self.on_selected)(x)
tree.children[0]
.state
.downcast_mut::<text_input::State<Renderer::Paragraph>>()
.unfocus();
(self.on_selected)(selection)
},
self.on_option_hovered.as_deref(),
&self.menu_class,