From 7dd599551b544f99bb4914755e6c3a04bd82cdec Mon Sep 17 00:00:00 2001 From: "tim.case" Date: Tue, 2 Jan 2024 15:38:45 +0000 Subject: [PATCH] Fix: Issue #14163 - AutoComplete: ArrowDown key no longer opens up the suggestions panel --- src/app/components/autocomplete/autocomplete.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/app/components/autocomplete/autocomplete.ts b/src/app/components/autocomplete/autocomplete.ts index 02ba2686edb..b54e512c6bd 100755 --- a/src/app/components/autocomplete/autocomplete.ts +++ b/src/app/components/autocomplete/autocomplete.ts @@ -1245,7 +1245,16 @@ export class AutoComplete implements AfterViewChecked, AfterContentInit, OnDestr onArrowDownKey(event) { if (!this.overlayVisible) { - return; + if(this.focused) { + const el = this.inputEL.nativeElement as HTMLInputElement | undefined; + if(el){ + // Put cursor at the end as the preventDefault blocks this behaviour + el.selectionStart = el.selectionEnd = el.value.length; + } + this.overlayVisible = true; + } else { + return; + } } const optionIndex = this.focusedOptionIndex() !== -1 ? this.findNextOptionIndex(this.focusedOptionIndex()) : this.findFirstFocusedOptionIndex();