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