mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-13 11:34:02 +08:00
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
This commit is contained in:
@@ -429,7 +429,7 @@ export default {
|
||||
}
|
||||
},
|
||||
value(val, oldVal) {
|
||||
if (!valueEquals(val, oldVal)) {
|
||||
if (!valueEquals(val, oldVal) && !this.pickerVisible) {
|
||||
this.dispatch('ElFormItem', 'el.form.change', val);
|
||||
}
|
||||
}
|
||||
@@ -893,6 +893,7 @@ export default {
|
||||
// determine user real change only
|
||||
if (!valueEquals(val, this.valueOnOpen)) {
|
||||
this.$emit('change', val);
|
||||
this.dispatch('ElFormItem', 'el.form.change', val);
|
||||
this.valueOnOpen = val;
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user