Skip to content

Commit 045be20

Browse files
committed
fix: make keydown more specific
1 parent ad383b7 commit 045be20

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/Validator.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,11 @@ class Validator {
117117
return !this.any()
118118
}
119119

120-
onKeydown(event: any, prefix?: string) {
121-
const { name } = event.target
120+
onKeydown(event: KeyboardEvent, prefix?: string) {
121+
const { name } = event.target as HTMLInputElement
122122
if (!name) return
123-
const nameWithPrefix = prefix ? `${prefix}.${name}` : null
124-
this.clear([name, nameWithPrefix])
123+
const names = prefix ? [name, `${prefix}.${name}`] : [name]
124+
this.clear(names)
125125
}
126126
}
127127

0 commit comments

Comments
 (0)