initbase / vue-modal-2

A simple and lightweight Vue (v2) modal component.
https://initbase.github.io/vue-modal-2/
MIT License
8 stars 4 forks source link

Auto close modal when try open twice #12

Open reualex opened 3 years ago

reualex commented 3 years ago

If we try open modal, next step - close and then open - modal window automatically will be closed. You can see it in your demo - https://codesandbox.io/s/vue-modal-2-vue2-forked-rfxwr

burhanahmeed commented 3 years ago

I don't get it, so I cannot make a reproduction. The demo seems fine to me.

Do you mean the fade effect when close the modal with button? 🤔

reualex commented 3 years ago

I don't get it, so I cannot make a reproduction. The demo seems fine to me.

Do you mean the fade effect when close the modal with button?

Sorry, try to nuxt demo - https://codesandbox.io/s/damp-architecture-b856k?file=/pages/index.vue, and try faster second open

burhanahmeed commented 3 years ago

Do you mean when I double click on the modal opener button, it closes immediately?

This is what I found

reualex commented 3 years ago

So, I created the video, you can see it - https://drive.google.com/file/d/1aFmC2dTqMEGM_p-JtdfmZ6D8WK3y1Oqy/view?usp=sharing (I didn't click twice, window close by self)

burhanahmeed commented 3 years ago

what browser are you on?

reualex commented 3 years ago

ubuntu, google chrome

burhanahmeed commented 3 years ago

I will try to resolve it once I have been able to reproduce it

micskubence commented 2 years ago

I edited your code, in Container.vue i moved the 'this.$emit("on-close", false);' line outside the settimeout (moving it before the settimeout) this fixed the auto close issue, also in withHeader.vue removed the @click event from the modal title h4 tag fixing a console error when clicking on the title.

burhanahmeed commented 2 years ago

@micskubence Cheers! Thanks a lot. It's been a while I haven't look at the code, I will try to look at the code again when I'm free.