Skip to content

Prevent closing a modal when clicking on a contained input#3663

Merged
westonruter merged 2 commits intodevelopfrom
fix/dont-close-modal-when-tapping-modal-inner
Oct 29, 2019
Merged

Prevent closing a modal when clicking on a contained input#3663
westonruter merged 2 commits intodevelopfrom
fix/dont-close-modal-when-tapping-modal-inner

Conversation

@schlessera
Copy link
Copy Markdown
Collaborator

Summary

This PR adds an action to a modal's .modal-inner element to immediately revert a modal.close action again.

This allows us to have the modal serve as a background that closes itself when clicking on and avoids the modal immediately closing again when clicking on an actual input within the modal.

This is a work-around as suggested in https://stackoverflow.com/a/45971501.

Fixes #3342

Checklist

  • My pull request is addressing an open issue (please create one otherwise).
  • My code is tested and passes existing tests.
  • My code follows the Engineering Guidelines (updates are often made to the guidelines, check it out periodically).

@googlebot googlebot added the cla: yes Signed the Google CLA label Oct 29, 2019
@schlessera schlessera added the Bug Something isn't working label Oct 29, 2019
@schlessera schlessera added this to the v1.4 milestone Oct 29, 2019
@westonruter westonruter merged commit ad38aa1 into develop Oct 29, 2019
@westonruter westonruter deleted the fix/dont-close-modal-when-tapping-modal-inner branch October 29, 2019 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working cla: yes Signed the Google CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add theme support for Twenty Twenty (and WordPress 5.3)

3 participants