-
I'm a bit confused, I show modal like this: const handleShowModal = () => {
const modal = document.getElementById('exp_modal');
modal && modal.showModal();
dispatch(openModal());
}; and my modal looks like this: <>
<dialog id='exp_modal' className='modal'>
<div className='modal-box flex justify-center '>
<ExpensesPage />
</div>
<form method='dialog' className='modal-backdrop'>
<button className='' onClick={() => dispatch(closeModal())}>
close
</button>
</form>
</dialog>
</> I wanna close modal not only by "close" button, but somewhere in my app in different places. |
Beta Was this translation helpful? Give feedback.
Answered by
saadeghi
Jul 2, 2024
Replies: 1 comment
-
HTML |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dkumza
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
.close()
method.HTML
<dialog>
docs:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog