Vuepic / vue-datepicker

Datepicker component for Vue 3
https://vue3datepicker.com
MIT License
1.48k stars 147 forks source link

:flow menu doesn't close if last flow step doesn't end with calendar #774

Closed zipl2 closed 7 months ago

zipl2 commented 7 months ago

Describe the bug The datepicker menu won't close if flow steps doesn't end with 'calendar'.

To Reproduce

<script setup>
import {ref} from 'vue'
import Datepicker from '@vuepic/vue-datepicker';
import '@vuepic/vue-datepicker/dist/main.css';

const date = ref(0);
</script>

<template>

  <Datepicker
    v-model="date"
    auto-apply
    :enable-time-picker="false"
    :close-on-auto-apply="true"
    :flow="['calendar', 'month', 'year']"    
  />

</template>

After selecting year, the menu should close, but it goes back to calendar. You can pick any date multiple times but the menu won't close. If you add 'calendar' as fourth (= last) step :flow="['calendar', 'month', 'year', 'calendar']" then it will close.

Expected behavior The menu should close when the last flow step is finished even if it isn't 'calendar' & the value should be applied to the model.

Desktop & mobile (please complete the following information):

Jasenkoo commented 7 months ago

There is no point in opening overlays after selecting the date, as it has no effect, making this point redundant.