Skip to content

Commit 8421df9

Browse files
committed
refactor(datepicker): Simplify slideDuration
1 parent ed78e87 commit 8421df9

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/components/DateInput.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ export default {
8282
type: Date,
8383
default: null,
8484
},
85+
slideDuration: {
86+
type: Number,
87+
default: 250,
88+
},
8589
translation: {
8690
type: Object,
8791
default() {
@@ -267,7 +271,7 @@ export default {
267271
268272
setTimeout(() => {
269273
this.shouldToggleOnClick = true
270-
}, 300)
274+
}, this.slideDuration)
271275
}
272276
},
273277
/**

src/components/DatePicker.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
:selected-date="selectedDate"
3131
:show-calendar-on-button-click="showCalendarOnButtonClick"
3232
:show-calendar-on-focus="showCalendarOnFocus"
33+
:slide-duration="slideDuration"
3334
:tabindex="tabindex"
3435
:translation="translation"
3536
:typeable="typeable"
@@ -587,7 +588,7 @@ export default {
587588
handlePageChange({ focusRefs, pageDate }) {
588589
this.setPageDate(pageDate)
589590
this.focus.refs = focusRefs
590-
this.focus.delay = this.slideDuration || 250
591+
this.focus.delay = this.slideDuration
591592
this.reviewFocus()
592593
this.$emit(`changed${this.ucFirst(this.nextView.up)}`, pageDate)
593594
},

src/mixins/pickerMixin.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ export default {
367367
delta,
368368
stepsRemaining,
369369
}
370-
const delay = this.slideDuration || 250
370+
const delay = this.slideDuration
371371
372372
if (stepsRemaining <= 0) {
373373
if (this.isMutedOrDisabled(currentElement)) {

0 commit comments

Comments
 (0)