Skip to content

Commit

Permalink
Fixed #8523 - p-autoComplete dropdown menu does not toggle closed on …
Browse files Browse the repository at this point in the history
…click of menu disclosure button
  • Loading branch information
yigitfindikli committed Apr 15, 2020
1 parent cfb09a3 commit 2eb4c23
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions src/app/components/autocomplete/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -485,18 +485,23 @@ export class AutoComplete implements AfterViewChecked,AfterContentInit,OnDestroy
}

handleDropdownClick(event) {
this.focusInput();
let queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;
if (!this.overlayVisible) {
this.focusInput();
let queryValue = this.multiple ? this.multiInputEL.nativeElement.value : this.inputEL.nativeElement.value;

if (this.dropdownMode === 'blank')
this.search(event, '');
else if (this.dropdownMode === 'current')
this.search(event, queryValue);
if (this.dropdownMode === 'blank')
this.search(event, '');
else if (this.dropdownMode === 'current')
this.search(event, queryValue);

this.onDropdownClick.emit({
originalEvent: event,
query: queryValue
});
this.onDropdownClick.emit({
originalEvent: event,
query: queryValue
});
}
else {
this.hide();
}
}

focusInput() {
Expand Down

0 comments on commit 2eb4c23

Please sign in to comment.