Skip to content

Commit

Permalink
Fix: Issue primefaces#14163 - AutoComplete: ArrowDown key no longer o…
Browse files Browse the repository at this point in the history
…pens up the suggestions panel
  • Loading branch information
Eagle-Tim committed Jan 2, 2024
1 parent e36ab22 commit 7dd5995
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 7dd5995

Please sign in to comment.