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

7399-clickableOverlay-less-fix - added pointer-events rule to .modal-… #15172

Conversation

alpacode-pmakowski
Copy link

@alpacode-pmakowski alpacode-pmakowski commented May 12, 2018

…popup class to let user click deeper than modals and reach to overlay's div in modal-wrapper div

To reproduce issue please see: #7399

Description

Problem: modal's overlay div would not catch click event because is covered by modal's div above. That's why modal is would not fire close event when user is clicking outside modal.

My proposition of solution for that issue is add pointer-events: none css rule to modals in theme's less files.

Fixed Issues (if relevant)

  1. Modal UI: clickableOverlay option doesn't work #7399: Modal UI: clickableOverlay option doesn't work

Test scenario

  1. Add a code to any .phtml template file:
<button id="btn-modal">
   Click to open modal
</button>

... add a js script code

require(['jquery', 'Magento_Ui/js/modal/modal'], function($, modal) {
  $('#btn-modal').click(function(e) {
      e.preventDefault();
      $('<p>Overlay content</p>').modal({ clickableOverlay: true }).modal('openModal');
  });
});
  1. Open modal and click to overlay to close it

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

…popup class to let user click deeper than modals and reach to overlay's div in modal-wrapper div
@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 12, 2018

CLA assistant check
All committers have signed the CLA.

@magento-engcom-team
Copy link
Contributor

Hi @virtua-pmakowski. Thank you for your contribution.
Changes from your Pull Request will be available with the upcoming 2.2.5 release.

@hamdrew
Copy link

hamdrew commented Jul 11, 2018

I do not see this code change when I updated to Magento 2.2.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants