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,
|
||||
&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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue