fix autocomplete focus

This commit is contained in:
Simon Gardling 2022-04-14 13:33:24 -04:00
parent ec391bc68f
commit 0c3939d4a7

View File

@ -136,12 +136,14 @@ impl FunctionEntry {
self.autocomplete.update_string(&new_string); self.autocomplete.update_string(&new_string);
if !self.autocomplete.hint.is_none() { if !self.autocomplete.hint.is_none() && re.has_focus() {
if !self.autocomplete.hint.is_single() {
if ui.input().key_pressed(Key::ArrowDown) { if ui.input().key_pressed(Key::ArrowDown) {
movement = Movement::Down; movement = Movement::Down;
} else if ui.input().key_pressed(Key::ArrowUp) { } else if ui.input().key_pressed(Key::ArrowUp) {
movement = Movement::Up; movement = Movement::Up;
} }
}
// Put here so these key presses don't interact with other elements // Put here so these key presses don't interact with other elements
let enter_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Enter); let enter_pressed = ui.input_mut().consume_key(Modifiers::NONE, Key::Enter);