From dde347e43e80d82c634b513bd749e402fc2c52ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=8E=E4=BC=9F=E6=9D=B0?= <674416404@qq.com> Date: Wed, 13 Nov 2024 23:34:03 +0800 Subject: [PATCH] fix: cannot read properties of undefined (reading 'handleBlur') --- src/input/input.tsx | 4 ++-- src/textarea/textarea.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/input/input.tsx b/src/input/input.tsx index 765583f7f..ff15bd50c 100644 --- a/src/input/input.tsx +++ b/src/input/input.tsx @@ -141,13 +141,13 @@ export default defineComponent({ nextTick(() => { setInputValue(innerValue.value); props.onBlur?.(innerValue.value, { e }); - formItem.handleBlur(); + formItem?.handleBlur(); }); return; } props.onBlur?.(innerValue.value, { e }); - formItem.handleBlur(); + formItem?.handleBlur(); }; const handleCompositionend = (e: CompositionEvent) => { diff --git a/src/textarea/textarea.tsx b/src/textarea/textarea.tsx index fc5c6e7fd..53188ffcf 100644 --- a/src/textarea/textarea.tsx +++ b/src/textarea/textarea.tsx @@ -109,7 +109,7 @@ export default defineComponent({ props.onFocus?.(innerValue.value, { e }); }; const handleBlur = (e: FocusEvent) => { - formItem.handleBlur(); + formItem?.handleBlur(); props.onBlur?.(innerValue.value, { e }); };