Skip to content

Commit

Permalink
Fixed #14035 - MultiSelect | Refactor input focus
Browse files Browse the repository at this point in the history
  • Loading branch information
cetincakiroglu committed Nov 6, 2023
1 parent c1df9fd commit 859620c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/app/components/multiselect/multiselect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1620,15 +1620,14 @@ export class MultiSelect implements OnInit, AfterViewInit, AfterContentInit, Aft
if (this.disabled || this.readonly || (<Node>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();
}
Expand Down

1 comment on commit 859620c

@vercel
Copy link

@vercel vercel bot commented on 859620c Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.