Skip to content

Commit

Permalink
fix: #13560 || DropDown clear or close icon on click dropDown options…
Browse files Browse the repository at this point in the history
… open randomly #13560 (#13564)

Co-authored-by: Md Ashik <ashik@jotno.net>
  • Loading branch information
ashikjs and ashikjs committed Aug 29, 2023
1 parent 06b1dc3 commit e8859c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/app/components/dropdown/dropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1057,10 +1057,12 @@ export class Dropdown implements OnInit, AfterViewInit, AfterContentInit, AfterV
}

isInputClick(event: MouseEvent): boolean {
const target: HTMLElement = event.target as HTMLElement;
return (
DomHandler.hasClass(event.target, 'p-dropdown-clear-icon') ||
(event.target as HTMLInputElement).isSameNode(this.accessibleViewChild?.nativeElement) ||
((this.editableInputViewChild && (event.target as HTMLInputElement).isSameNode(this.editableInputViewChild.nativeElement)) as boolean)
DomHandler.hasClass(target, 'p-dropdown-clear-icon') ||
target.closest('.p-dropdown-clear-icon') !== null ||
(target as HTMLInputElement).isSameNode(this.accessibleViewChild?.nativeElement) ||
((this.editableInputViewChild && (target as HTMLInputElement).isSameNode(this.editableInputViewChild.nativeElement)) as boolean)
);
}

Expand Down

0 comments on commit e8859c8

Please sign in to comment.