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
931 stars 99 forks source link

Destroy modal in unmount parent #443

Closed JohnnyMaynne closed 6 months ago

JohnnyMaynne commented 6 months ago

Version

vue-final-modal: v4.5.4 vue: v3.4.20 nuxt: v3.9.1

OS

Mac

Reproduction Link

I can't leave a reproduction link, but I'm attaching the video:

https://github.com/vue-final/vue-final-modal/assets/26120256/e3f8f778-ff6a-4867-914c-ba4f1a6f5364

What is actually happening?

Good afternoon. Thank you for the excellent package. I encountered the same problem - I have boards and tasks. I open tasks in a modal window and change the status of the task and it moves to another board and at this moment the task closes, but if I change other parameters of the task that do not affect its movement between boards, everything works fine.

Maybe I'm doing something wrong, but it seems to me that this happens when the component from which I call the modal window is unmounted.

I'm using dynamic modal windows and the call goes like this.

const { open } = useModal({ component: TaskShow, attrs: { task: props.task.id, }, });

JohnnyMaynne commented 6 months ago

moved the modal call to a service and this solved the problem