fix combo-box text not getting cleared when clicking on selection

This commit is contained in:
edwloef 2025-09-24 10:30:09 +02:00
parent 0a34496c79
commit f470333242
No known key found for this signature in database

View file

@ -862,14 +862,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,