check whether event target is input element

This commit is contained in:
MaysWind
2025-01-27 20:36:55 +08:00
parent e2a4e0cb3f
commit 4878c7258d
+1 -1
View File
@@ -263,7 +263,7 @@ function onPaste(e: ClipboardEvent): void {
}
function onClick(e: MouseEvent): void {
if (!props.disabled && !props.readonly && props.modelValue === 0) {
if (!props.disabled && !props.readonly && props.modelValue === 0 && e.target instanceof HTMLInputElement) {
const input = e.target as HTMLInputElement;
input?.select();
}