move variable assignment

This commit is contained in:
Simon Gardling 2022-04-04 10:19:03 -04:00
parent 3aee254de2
commit 02f73e6be6

View File

@ -39,8 +39,6 @@ impl AutoComplete {
let enter_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Enter); 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 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 // update self
self.changed(&string); self.changed(&string);
@ -48,6 +46,8 @@ impl AutoComplete {
.hint_forward(true) // Make the hint appear after the last text in the textbox .hint_forward(true) // Make the hint appear after the last text in the textbox
.lock_focus(true); .lock_focus(true);
let te_id = ui.make_persistent_id(format!("text_edit_ac_{}", func_i));
if self.hint.is_none() { if self.hint.is_none() {
let re = func_edit.id(te_id).ui(ui); let re = func_edit.id(te_id).ui(ui);
let return_string = (&new_string).to_string(); let return_string = (&new_string).to_string();