From db975819697a8fddf1dd8ff5652525704fcd5380 Mon Sep 17 00:00:00 2001 From: neverland Date: Mon, 15 Nov 2021 10:46:34 +0800 Subject: [PATCH] fix(Field): should not trigger validation after blurring readonly input (#9862) --- packages/vant/src/field/Field.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/vant/src/field/Field.tsx b/packages/vant/src/field/Field.tsx index 59882e305..8f0913ee7 100644 --- a/packages/vant/src/field/Field.tsx +++ b/packages/vant/src/field/Field.tsx @@ -310,13 +310,16 @@ export default defineComponent({ nextTick(adjustTextareaSize); // readonly not work in legacy mobile safari - const readonly = getProp('readonly'); - if (readonly) { + if (getProp('readonly')) { blur(); } }; const onBlur = (event: Event) => { + if (getProp('readonly')) { + return; + } + state.focused = false; updateValue(getModelValue(), 'onBlur'); emit('blur', event);