AndrewBastin / vue-promise-modals

A Vue 3 library to create modals that are resolved with promises.
https://vue-promise-modals.andrewbast.in
MIT License
4 stars 1 forks source link

Use promisified modals with headlessui #1

Open mrhighstone opened 2 weeks ago

mrhighstone commented 2 weeks ago

I'm excited about your promisified modal solution and thinking of getting this to work with Headlessui. Especially the modal and drawer components. Would you think this is possible?

Is the ModalSystem tied to a specific implementation? How does the openModel know what modal (eg a modal or drawer component) to open?

AndrewBastin commented 2 weeks ago

@mrhighstone I am not sure about the drawer (this library isn't specifically made for this use case for the most part).

The demo site code is also present in this repo, see https://github.com/AndrewBastin/vue-promise-modals/tree/main/demo/src/components/example for reference implementations. When you call openModal it renders the component passed to it, so you can just give in your dialog component and it should be fine.

I don't see why it shouldn't work with the Headless UI dialog components

mrhighstone commented 3 days ago

Just wanted to let you that I managed to get it to work. Both the modal and drawer.

Many thanks for the good work, saves me a lot of hassle in opening, closing and evaluating the results!