Closed bmincof closed 1 year ago
Hi @bmincof,
please see this example for how to properly handle open and close states using the backdrop
property and a ref: https://react-daisyui.netlify.app/?path=/story/actions-modal--clicked-outside
By setting open
manually with state AND using the backdrop
prop, you're sort of mixing two different ideas. The new modal uses an HTML <dialog>
which is why we can use the showModal()
and close()
functions that are native to the tag.
If you want to just use state, you could use <Modal.Legacy>
along with the onClickBackdrop()
callback to set the state to false. See this example: https://react-daisyui.netlify.app/?path=/story/actions-modal-legacy--clicked-outside
@benjitrosch, thanks for the quick response!
Hello!
I want to use
Cliked Outside Modal
. so I set thebackdrop
props of Modal totrue
, but nothing works. How can I use this? please help...Here is my code.