Skip to content

Commit b70da53

Browse files
wacky6jikkai
authored andcommitted
DatePicker: improve form change validation (#12348)
watch.value will keep firing during time picker selection it now detects whether panel is closed before firing el.form.change
1 parent 02176e2 commit b70da53

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/date-picker/src/picker.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ export default {
429429
}
430430
},
431431
value(val, oldVal) {
432-
if (!valueEquals(val, oldVal)) {
432+
if (!valueEquals(val, oldVal) && !this.pickerVisible) {
433433
this.dispatch('ElFormItem', 'el.form.change', val);
434434
}
435435
}
@@ -893,6 +893,7 @@ export default {
893893
// determine user real change only
894894
if (!valueEquals(val, this.valueOnOpen)) {
895895
this.$emit('change', val);
896+
this.dispatch('ElFormItem', 'el.form.change', val);
896897
this.valueOnOpen = val;
897898
}
898899
},

0 commit comments

Comments
 (0)