diff --git a/src/widgets.rs b/src/widgets.rs index 13a7551..821a871 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -39,8 +39,6 @@ impl AutoComplete { let enter_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Enter); let tab_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Tab); - let te_id = ui.make_persistent_id(format!("text_edit_ac_{}", func_i)); - // update self self.changed(&string); @@ -48,6 +46,8 @@ impl AutoComplete { .hint_forward(true) // Make the hint appear after the last text in the textbox .lock_focus(true); + let te_id = ui.make_persistent_id(format!("text_edit_ac_{}", func_i)); + if self.hint.is_none() { let re = func_edit.id(te_id).ui(ui); let return_string = (&new_string).to_string();