diff --git a/src/app/components/multiselect/multiselect.ts b/src/app/components/multiselect/multiselect.ts index a340481aac0..107c5cafb00 100755 --- a/src/app/components/multiselect/multiselect.ts +++ b/src/app/components/multiselect/multiselect.ts @@ -1620,15 +1620,14 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft if (this.disabled || this.readonly || (event.target).isSameNode(this.focusInputViewChild?.nativeElement)) { return; } - - this.focusInputViewChild?.nativeElement.focus({ preventScroll: true }); - + if (event.target.tagName === 'INPUT' || event.target.getAttribute('data-pc-section') === 'clearicon' || event.target.closest('[data-pc-section="clearicon"]')) { + event.preventDefault(); return; } else if (!this.overlayViewChild || !this.overlayViewChild.el.nativeElement.contains(event.target)) { this.overlayVisible ? this.hide(true) : this.show(true); } - + this.focusInputViewChild?.nativeElement.focus({ preventScroll: true }); this.onClick.emit(event); this.cd.detectChanges(); }