Skip to content

Commit

Permalink
refactor on primefaces@de3ffd6
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Feb 7, 2024
1 parent 87b5b24 commit b92cb23
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1451,7 +1451,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
break;

case 'Enter':
this.onEnterKey(event);
this.onEnterKey(event, true);
break;

case 'Escape':
Expand Down Expand Up @@ -1660,7 +1660,7 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
!this.editable && !pressedInInputText && this.onEnterKey(event);
}

onEnterKey(event) {
onEnterKey(event, pressedInInput = false) {
if (!this.overlayVisible) {
this.focusedOptionIndex.set(-1);
this.onArrowDownKey(event);
Expand All @@ -1669,6 +1669,8 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
const option = this.visibleOptions()[this.focusedOptionIndex()];
this.onOptionSelect(event, option);
}

!pressedInInput && this.hide();
}

event.preventDefault();
Expand Down

0 comments on commit b92cb23

Please sign in to comment.