Skip to content

Commit

Permalink
Fix change detection for date range values
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanreyes committed Feb 6, 2022
1 parent efd0b08 commit 9d6e896
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/components/DatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,9 @@ export default {
this.$set(this, valueKey, normalizedValue);
// Clear drag value if needed
if (!isDragging) this.dragValue = null;
}
// 4. Denormalization/Notification
if (valueChanged) {
// 4A. Denormalization
// Denormalization
const denormalizedValue = this.denormalizeValue(normalizedValue);
// 4B. Notification
// Notification
const event = this.isDragging ? 'drag' : 'input';
this.watchValue = false;
this.$emit(event, denormalizedValue);
Expand All @@ -631,7 +627,7 @@ export default {
},
hasValue(value) {
if (this.isRange) {
return isObject(value) && value.start && value.end;
return isObject(value) && !!value.start && !!value.end;
}
return !!value;
},
Expand Down

0 comments on commit 9d6e896

Please sign in to comment.