vue-final / vue-final-modal

🍕Vue Final Modal is a tiny, renderless, mobile-friendly, feature-rich modal component for Vue.js.
https://vue-final-modal.org
MIT License
862 stars 95 forks source link

Scoped slots close action breaks modal #424

Closed angelinanikolaeva closed 4 months ago

angelinanikolaeva commented 5 months ago

Version

vue-final-modal: 4.5.3 vue: 3.3.8 nuxt: 3.8.1

OS

Windows

Reproduction Link

https://stackblitz.com/edit/github-jd9emd?file=src%2Fcomponents%2FMyModal.vue

Steps to reproduce

Use scoped slots with close action in any modal like this:

<VueFinalModal>
  <template #default="{ close }">
    <button @click="() => close()">
      Cancel
    </button>
  </template>
</VueFinalModal>

What is Expected?

The modal works after closing it from inside using scoped slots

What is actually happening?

When the modal is opened, a click on the close button from scoped slots closes it like it shoud, but the modal won't open again. If clicked on modal overlay, everything works fine. Usage of @click="emit('update:modelValue', false)" instead of slots also works

hunterliu1003 commented 4 months ago

Should be fixed in v4.5.4