Merge pull request #3063 from edwloef/combo-box-click-fix
Fix `combo_box` text not getting cleared on selection
This commit is contained in:
commit
9e1340f36f
1 changed files with 11 additions and 7 deletions
|
|
@ -897,14 +897,18 @@ where
|
||||||
menu,
|
menu,
|
||||||
&filtered_options.options,
|
&filtered_options.options,
|
||||||
hovered_option,
|
hovered_option,
|
||||||
|x| {
|
|selection| {
|
||||||
tree.children[0]
|
self.state.with_inner_mut(|state| {
|
||||||
.state
|
state.value = String::new();
|
||||||
.downcast_mut::<text_input::State<Renderer::Paragraph>>(
|
state.filtered_options.update(self.state.options.clone());
|
||||||
)
|
});
|
||||||
.unfocus();
|
|
||||||
|
|
||||||
(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.on_option_hovered.as_deref(),
|
||||||
&self.menu_class,
|
&self.menu_class,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue