I tried ngx-otp-input with ionic 5 like in the example https://www.npmjs.com/package/ngx-otp-input#otpchange , but autofocus doesn't work for me. Any ideas?
I tried ngx-otp-input with ionic 5 like in the example https://www.npmjs.com/package/ngx-otp-input#otpchange , but autofocus doesn't work for me. Any ideas?
Add in HTML
<ngx-otp-input [config]="otpInputConfig" (otpChange)="handeOtpChange($event)" (fill)="handleFillEvent($event)">
</ngx-otp-input>
Add in TS File
otpInputConfig: NgxOtpInputConfig = {
otpLength: 6,
autofocus: true,
classList: {
inputBox: "my-super-box-class",
input: "my-super-class",
inputFilled: "my-super-filled-class",
inputDisabled: "my-super-disable-class",
inputSuccess: "my-super-success-class",
inputError: "my-super-error-class"
}
};
handeOtpChange(value: string[]): void {
console.log(value);
}
handleFillEvent(value: string): void {
console.log(value);
}