Vuepic / vue-datepicker

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

Selected value disappears when clicking outside datepicker and using `internal-model-change` #848

Closed laurens94 closed 2 months ago

laurens94 commented 2 months ago

Describe the bug Since version 8.4.0 the selected value disappears whenever I click outside the modal.

To Reproduce This only seems to happen when using the @internal-model-change event.

  1. Go to https://stackblitz.com/edit/vuepic-vue-datepicker-1huhba?file=src%2Fcomponents%2FPlayground.vue
  2. Click on the datepicker
  3. Select a date
  4. Open the datepicker again
  5. Click outside the picker modal
  6. See how the selected value disappears

Expected behavior I expect the same behavior as when @internal-model-change is not being used.

Screenshots

The issue

https://github.com/Vuepic/vue-datepicker/assets/5780704/f38db917-93bc-4d76-b626-eec49ef58bd8

Expected behavior

https://github.com/Vuepic/vue-datepicker/assets/5780704/0acf8f7f-2a83-4e7a-8305-06f006ad90ac

Desktop & mobile (please complete the following information):