From 0c3939d4a7e311a0c86fa796cb8a4cb66cdb3557 Mon Sep 17 00:00:00 2001 From: Simon Gardling Date: Thu, 14 Apr 2022 13:33:24 -0400 Subject: [PATCH] fix autocomplete focus --- src/function.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/function.rs b/src/function.rs index 288b3e5..f9dc3fa 100644 --- a/src/function.rs +++ b/src/function.rs @@ -136,11 +136,13 @@ impl FunctionEntry { self.autocomplete.update_string(&new_string); - if !self.autocomplete.hint.is_none() { - if ui.input().key_pressed(Key::ArrowDown) { - movement = Movement::Down; - } else if ui.input().key_pressed(Key::ArrowUp) { - movement = Movement::Up; + if !self.autocomplete.hint.is_none() && re.has_focus() { + if !self.autocomplete.hint.is_single() { + if ui.input().key_pressed(Key::ArrowDown) { + movement = Movement::Down; + } else if ui.input().key_pressed(Key::ArrowUp) { + movement = Movement::Up; + } } // Put here so these key presses don't interact with other elements