Skip to content

Commit

Permalink
(fix) Check for Node.contains method avalaibility
Browse files Browse the repository at this point in the history
`Node.contains` is not supported in FireFox < 9.
Allows trapping the focus inside the overlay to work as expected.
  • Loading branch information
feimosi committed Mar 11, 2017
1 parent 1d368f6 commit 7a39ba5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/baguetteBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
};

var trapFocusInsideOverlay = function(event) {
if (overlay.style.display === 'block' && !overlay.contains(event.target)) {
if (overlay.style.display === 'block' && (overlay.contains && !overlay.contains(event.target))) {
event.stopPropagation();
initFocus();
}
Expand Down

0 comments on commit 7a39ba5

Please sign in to comment.