From 84c5629db1ac9fde0c957499fd963b4f0c24d830 Mon Sep 17 00:00:00 2001 From: Ian Chadwick Date: Sat, 24 Oct 2015 10:26:44 +0100 Subject: [PATCH] Fix bug with click handling when using SVGs Add a check on the has method to make sure that node.className is a string as this isn't the case when the node is an SVG and means click handling breaks as the trim method doesn't exist on the object --- src/dom/classes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dom/classes.js b/src/dom/classes.js index 3f6e9b2a97..8458a24f46 100644 --- a/src/dom/classes.js +++ b/src/dom/classes.js @@ -67,7 +67,7 @@ define([ * @memberOf dom */ function has(node, value) { - return Nodes.isElementNode(node) + return Nodes.isElementNode(node) && typeof node.className === 'string' && node.className.trim().split(Strings.WHITE_SPACES).indexOf(value) >= 0; }