diff --git a/src/digital-components/date-picker/date-picker.vue b/src/digital-components/date-picker/date-picker.vue index 32fe7f5f3..63449320c 100644 --- a/src/digital-components/date-picker/date-picker.vue +++ b/src/digital-components/date-picker/date-picker.vue @@ -267,9 +267,7 @@ export default { const inshopFirstDate = Array.isArray(this.selectableDatesInshop) ? this.selectableDatesInshop[0]?.date : null; - return this.isMobileSelected && mobileFirstDate - ? mobileFirstDate + "-mobile" - : inshopFirstDate; + return (this.isMobileSelected && mobileFirstDate) ? mobileFirstDate + "-mobile" : inshopFirstDate; }, }, methods: { @@ -542,8 +540,6 @@ export default { } this.months = months; this.isLoading = false; - // if done loading dates, then set to first available date - if (!this.selectedDate) this.selectedDate = this.firstAvailableSelectableDate; if (config.preSelectedDate) { this.$nextTick(() => { @@ -777,9 +773,6 @@ export default { ); this.isLoading = false; - // if done loading dates, then set to first available date - if (!this.selectedDate) this.selectedDate = this.firstAvailableSelectableDate; - this.hideSomeDaysForInitialView = false; // if hid days on initial partial view, this will reveal those days monthToShow.monthClass = monthToShow.monthClass.replace(" month-hidden", ""); this.scrollToElement(monthToShow.monthString); @@ -851,6 +844,12 @@ export default { }, }, watch: { + isLoading(newValue) { + // if done loading dates, then set to first available date + if (newValue === false && this.firstAvailableSelectableDate) { + this.selectedDate = this.firstAvailableSelectableDate; + } + }, modelValue(newValue) { this.resetField({ value: newValue,