-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transitions from the HeadlessUI's library don't work #23
Comments
Hi, Eri! Thanks for the kind words! I'm glad that my package is useful. I checked Headless UI and it works well with my package. You just need to give it some time to execute the leave transition.
|
Full example (I got the code from Headless UI docs):
The Component:
|
Another option is to use this function useConfirmDialog. It's pretty much the same, but without |
Hey there, thanks for the quick answers and explanations! I tried your two first answers here, and although they fix the transition when the modal is leaving, still there is no transition when the modal is showing. I also tried to do it with setTimeout like this:
but with no effect. I also tried to add a wrapper on so I could show it firstly and then the TransitionRoot with a setTimouet, but again, that wasn't a solution. As for the last option you provided, I'm not very positive in adding a library just for this, although it looks like a neat package and maybe we can add it in the future. |
@erip2 can you provide your code? Because in mine both transitions work. |
Sure, my main component is this:
I was inspired by this article: https://dev.to/garmideroman/the-simplest-way-to-deal-with-modal-dialogs-in-vue-3-59hl, especially the "Reusing" section. In this way I have this file: useConfirmBeforeAction.vue
and finally, on the component I want this modal, I have a button that when it's clicked, it calls this function:
|
|
A typo, it's a
I tried it like this, but still no success. Anyway, it's obvious that there's something wrong on my end. I'll investigate it further. Thanks for the answers! |
@erip2 you're welcome! |
@erip2 did you find out what the problem was? |
@erip2 Oh no, you should always put |
Mm, I based the logic from here tailwindlabs/headlessui#426 (comment) Also, because when I tried to place it outside (which would be perfect in my case since almost every page should have a confirm dialog), the |
@erip2 you should place it only once in |
My package works differently. In the case of nested modals, you just need to create a new dialog with The |
Hello there again @harmyderoman ! Anyway, I managed to create a sandbox for you to see: https://codesandbox.io/s/vuejs-confirm-dialog-esc-example-luxigt As you can see, when Thanks! |
Hi, @erip2! Please open new issue for this topic. I'll try to help you. |
Hey there!
I am using your package and it's very good. It really makes it easy and reusable this kind of component throughout the application. I am also new to Vue, so I am sorry if the title doesn't make sense.
The only problem that I have with the package is the component. The thing is that I use HeadlessUI (https://headlessui.com/) and their modal has transitions before and after the modal is shown. I want these transitions to be consistent in all the app modals.
But because your package wraps the confirm dialogs inside the DialogsWrapper the transition doesn't happen, because the component is mounted/unmounted with the wrapper's logic.
Is it possible for me to extend this component or maybe you can make some changes in the package if you think that this issue is more universal?
Thanks!
The text was updated successfully, but these errors were encountered: