Skip to content

Commit

Permalink
Safer click target check
Browse files Browse the repository at this point in the history
  • Loading branch information
lukemelia committed Mar 3, 2018
1 parent 8d78c1e commit 984a155
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/components/basic-dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ export default Component.extend({
}

// if the click is within the dialog, do nothing
if (document.querySelector(modalSelector).contains(target)) {
let modalEl = document.querySelector(modalSelector);
if (modalEl && modalEl.contains(target)) {
return;
}

Expand Down

0 comments on commit 984a155

Please sign in to comment.