woylie / doggo

Headless UI components for Phoenix
MIT License
200 stars 6 forks source link

Modal component don't support native modal mode #247

Open sezaru opened 4 months ago

sezaru commented 4 months ago

Is your feature request related to a problem? Please describe. The <dialog> element supports two ways to show its content, the first is modelessly which is the way that Doggo seems to support right now.

The second one with a modal mode that will make the dialog over the top of any other dialogs that might be present. Everything outside the dialog are inert with interactions outside the dialog being blocked.

More info here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLDialogElement#instance_methods

Describe the solution you'd like A way to show the dialog with modal mode which needs to call dialog.showModal() function (and also a way to do the same for closing it with the dialog.close() function.

Describe alternatives you've considered I can implement this myself but I think it would be better to have built-in support in doggo since I believe that is the way most of users would want to use the dialog element.

woylie commented 4 months ago

Thanks, makes sense to me. We don't bundle JavaScript yet, but as soon as we do, we can make the update.