From 02f73e6be660b47047fd094466b5a60d210c27d5 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Mon, 4 Apr 2022 10:19:03 -0400 Subject: [PATCH] move variable assignment --- src/widgets.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();