Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves unexpected closure of nested modals when the parent is a Bootstrap modal #18

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

blasferna
Copy link
Owner

When opening a formset modal on top of a main Bootstrap modal, currently pressing the Escape key closes both modals, the secondary and the main one.

This behavior is not the expected one, as the secondary modal should close when pressing Escape, but the main modal should remain open.

This Pull Request implements the necessary changes to fix this issue and achieve the expected behavior:

  • The keydown.dismiss.bs.modal event is disabled when opening the formset modal, preventing it from closing when pressing Escape.
  • The secondary modal closes correctly when pressing Escape.
  • When closing the secondary modal, the keydown.dismiss.bs.modal event is re-enabled for the main Bootstrap modal.
  • The main Bootstrap modal remains open when the secondary modal is closed by pressing Escape.

@blasferna blasferna merged commit a7db759 into main Mar 22, 2024
@blasferna blasferna deleted the modal-over-bs-modal branch March 22, 2024 19:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant