This repository has been archived by the owner on May 29, 2019. It is now read-only.
fix(modal): prevent doubleclick from closing multiple nested modals #6116
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
In the normal Bootstrap library, double clicking on the backdrop of a nested modal results in just the nested modal closing. It waits for the modal-closing animation to complete, and once it is, the user can then click on the next backdrop to close the remaining modal.
The current Angular UI code doesn't do this because every time any backdrop is clicked, the top modal on the $modalStack is chosen for closing.
This PR prevents this functionality by simply adding a boolean value backdropClosing that, when true, will prevent the code from executing another modal close. Returning backdropClosing to false is unnecessary and won't affect the next modal close.
Closes #6061