Fixes #1427: add event delegation so that modals do not close by mistake #1430
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.
See #1427: when using shinyjs, modals were closing incorrectly when an element inside it them was triggered as hidden.
Example app:
Before this fix, the modal in the app above would be removed entirely when the
toggle
button was pressed. I think this is because the modal's "hidden.bs.modal" event was bubbling down to the elements inside of it (i.e. if any element inside it was triggered as hidden, it would register that as a hidden event for the whole modal and remove it). With this fix, the "hidden.bs.modal" event only applies to elements with class "shiny-modal-wrapper", so the app above works as expected.