From 589bd3f7a0e8e8a287221bae34c75becb9048a03 Mon Sep 17 00:00:00 2001 From: Mike Mariano Date: Mon, 31 Aug 2015 12:09:57 -0700 Subject: [PATCH] Fix Node.contains bug in Firefox On Firefox there is anonymous div's inside input elements. Explanation here: https://bugzilla.mozilla.org/show_bug.cgi?id=208427. Fixes gh-193 Closes gh-215 --- src/dispatcher.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dispatcher.js b/src/dispatcher.js index efb8c447..5b62d7bd 100644 --- a/src/dispatcher.js +++ b/src/dispatcher.js @@ -145,7 +145,12 @@ var dispatcher = { } }, contains: /*scope.external.contains || */function(container, contained) { - return container.contains(contained); + try { + return container.contains(contained); + } catch(ex) { + // most likely: https://bugzilla.mozilla.org/show_bug.cgi?id=208427 + return false; + } }, // EVENTS