Autofocus is not working for P-inputNumber

UI Components for Angular
Post Reply
gokuldeva
Posts: 3
Joined: 29 Nov 2022, 07:11

29 Nov 2022, 08:16

I am uisng P-inputNumber inside aggrid cell editor, when I am clicking the cell the input box is not focusing, so the user have to click again, I have tried ngafterviewinit method also its not works.

Steps to reproduce:-

1)add this to cell editor component of html.
<p-inputNumber [(ngModel)]="value9" inputId="currency-us" mode="currency" currency="USD" locale="en-US"
[pAutoFocus]="true">

2)add this to cell edtor component of ts.
ngAfterViewInit() {
// focus on the input
setTimeout(() => this.input.element.nativeElement.pAutoFocus = true);
}

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 7 guests