multiselect onPanelShow sets the focus to filter

UI Components for Angular
Post Reply
pilar
Posts: 6
Joined: 27 Feb 2017, 14:49

14 Mar 2019, 10:41

Hello!

How could I indicate to p-multiselect component that the focus must be set on filter when the options panel is opened?

I've tried the following solution but seems doesn't work:

component.html

Code: Select all

<p-multiSelect #type  (onPanelShow)="setFocusToFilter()"
component.ts

Code: Select all

 @ViewChild("type") typeDom;
setFocusToFilter() {
    this.typeDom.filterInputChild.nativeElement.focus();
Would you have any suggestions?

Many thanks,
Pilar

yigitfindikli
Posts: 314
Joined: 08 Aug 2018, 14:09

29 Mar 2019, 10:11

pilar wrote:
14 Mar 2019, 10:41
Hello!

How could I indicate to p-multiselect component that the focus must be set on filter when the options panel is opened?

I've tried the following solution but seems doesn't work:

component.html

Code: Select all

<p-multiSelect #type  (onPanelShow)="setFocusToFilter()"
component.ts

Code: Select all

 @ViewChild("type") typeDom;
setFocusToFilter() {
    this.typeDom.filterInputChild.nativeElement.focus();
Would you have any suggestions?

Many thanks,
Pilar
Hi,

What is your primeng version ? Multiselect already doing this. You can see in demo https://www.primefaces.org/primeng/#/multiselect .

Best Regards.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests