From 6162b3e271dd7ba53f9e0ac58df35fb0f33256ae Mon Sep 17 00:00:00 2001 From: Kris <491393490@qq.com> Date: Mon, 20 Dec 2021 11:43:50 +0800 Subject: [PATCH] Fix iPhone13 bug Fixed a problem where you couldn't switch to the next input box on iPhone 13 --- angular-code-input/src/lib/code-input.component.html | 2 +- angular-code-input/src/lib/code-input.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/angular-code-input/src/lib/code-input.component.html b/angular-code-input/src/lib/code-input.component.html index bf2a8fc..fb31d7f 100644 --- a/angular-code-input/src/lib/code-input.component.html +++ b/angular-code-input/src/lib/code-input.component.html @@ -4,7 +4,7 @@ (click)="onClick($event)" (paste)="onPaste($event, i)" (input)="onInput($event, i)" - (keydown)="onKeydown($event, i)" + (keyup)="onKeyup($event, i)" [type]="inputType" [inputmode]="inputMode" [disabled]="disabled" diff --git a/angular-code-input/src/lib/code-input.component.ts b/angular-code-input/src/lib/code-input.component.ts index 96b9c61..a7f75c2 100644 --- a/angular-code-input/src/lib/code-input.component.ts +++ b/angular-code-input/src/lib/code-input.component.ts @@ -250,7 +250,7 @@ export class CodeInputComponent implements AfterViewInit, OnInit, OnChanges, OnD this.emitChanges(); } - async onKeydown(e: any, i: number): Promise { + async onKeyup(e: any, i: number): Promise { const target = e.target; const isTargetEmpty = this.isEmpty(target.value); const prev = i - 1;