AutoFocus

AutoFocus manages focus on focusable element on load.


import { AutoFocusModule } from 'primeng/autofocus';

AutoFocus is applied to any focusable input element with the pAutoFocus directive.


<input type="text" pInputText [pAutoFocus]="true" placeholder="Automatically focused" />

Summer Sale 2025
SUMMER SALE2025
Use coupon code PRSM25 at checkout to get 50% OFF everything in PrimeStore and PrimeBlocks.
Learn More