creativetimofficial / tailwind-starter-kit

Tailwind Starter Kit a beautiful extension for TailwindCSS, Free and Open Source
https://www.creative-tim.com/learning-lab/tailwind-starter-kit#/presentation
MIT License
5.69k stars 890 forks source link

prevent modal from closing in react #8

Closed Merrick17 closed 3 years ago

Merrick17 commented 3 years ago

I'm trying to add inputs to the modal using the react example, however when i click on the input to write the modal automatically close

einazare commented 3 years ago

Hello there, @Merrick17 ,

Please provide us with your sample code, and we'll see what we can do.

Best, Manu

Merrick17 commented 3 years ago

` <> <button className="bg-pink-500 text-white active:bg-pink-600 font-bold uppercase text-sm px-6 py-3 rounded shadow hover:shadow-lg outline-none focus:outline-none mr-1 mb-1" type="button" style={{ transition: "all .15s ease" }} onClick={() => setShowModal(true)}

Open regular modal {showModal ? ( <> <div className="justify-center items-center flex overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none" onClick={() => setShowModal(false)}

{/*content*/}
{/*header*/}

Modal Title

{/*body*/}

I always felt like I could do anything. That’s the main thing people are controlled by! Thoughts- their perception of themselves! They're slowed down by their perception of themselves. If you're taught you can’t do anything, you won’t do anything. I was taught I could do everything.

{/*footer*/}

</> ) : null} </>` I took this code snippet and tried to integrate it however no matter where i click it closes

einazare commented 3 years ago

Hello again, @Merrick17 ,

Please un-minify the code snippet.

Best, Manu