Fix modal closing issue when clicking inside dialog
The modal was closing when clicking on input fields or trying to type
because the click event handler was checking if e.target.classList.contains('modal')
which could incorrectly trigger when clicking on certain elements.
Fixed by using closest() to properly detect if the click happened inside
a .modal-dialog element. The modal now only closes when clicking on the
backdrop (outside the dialog), not when interacting with form elements.
Showing
Please
register
or
sign in
to comment