Skip to content

Commit

Permalink
DatePicker: improve form change validation (#12348)
Browse files Browse the repository at this point in the history
watch.value will keep firing during time picker selection
it now detects whether panel is closed before firing el.form.change
  • Loading branch information
wacky6 authored and jikkai committed Aug 15, 2018
1 parent 02176e2 commit b70da53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/date-picker/src/picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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;
}
},
Expand Down

0 comments on commit b70da53

Please sign in to comment.