daisyui / react-daisyui

daisyUI components built with React 🌼
http://react.daisyui.com/
MIT License
886 stars 98 forks source link

Modal form change proposal #416

Closed victorcarvalhosp closed 9 months ago

victorcarvalhosp commented 10 months ago

Right now it's not possible to add a form inside a Modal as it throws this error: Warning: validateDOMNesting(...): <form> cannot appear as a descendant of <form>.

Clicking on any button inside the modal closes it as well, which is not always intended.

This PR proposes to change this behavior, if a user want to close the modal he can always use:

<form method="dialog">
            <Button>Close</Button>
 </form>

or <Button onClick={toggleModal}>Close me</Button> inside the modal.

This is a proposal change for this opened issue: https://github.com/daisyui/react-daisyui/issues/415

netlify[bot] commented 10 months ago

Deploy Preview for react-daisyui processing.

Name Link
Latest commit b3a3c6853303bee65b08a76f562072ccaefe363c
Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/64f9144632f5630008649d6c
netlify[bot] commented 10 months ago

Deploy Preview for react-daisyui ready!

Name Link
Latest commit b3a3c6853303bee65b08a76f562072ccaefe363c
Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/64f9144632f5630008649d6c
Deploy Preview https://deploy-preview-416--react-daisyui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] commented 10 months ago

Deploy Preview for react-daisyui processing.

Name Link
Latest commit b3a3c6853303bee65b08a76f562072ccaefe363c
Latest deploy log https://app.netlify.com/sites/react-daisyui/deploys/64f9144632f5630008649d6c
yoshi6jp commented 10 months ago

Related to this commit https://github.com/saadeghi/daisyui/commit/314761e35fd7b186e6556d21417ec8aa8e43dcec

LGTM 👍