Skip to content

Commit 741d47a

Browse files
committed
Fix waves SVG error and use parentNode which has more predictable behavior for SVG elements in IE 11
1 parent 8555d14 commit 741d47a

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

js/waves.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,13 @@
258258
var element = null;
259259
var target = e.target || e.srcElement;
260260

261-
while (target.parentElement !== null) {
261+
while (target.parentNode !== null) {
262262
if (!(target instanceof SVGElement) && target.className.indexOf('waves-effect') !== -1) {
263263
element = target;
264264
break;
265-
} else if (target.className.indexOf('waves-effect') !== -1) {
266-
element = target;
267-
break;
268265
}
269-
target = target.parentElement;
266+
target = target.parentNode;
270267
}
271-
272268
return element;
273269
}
274270

@@ -320,7 +316,7 @@
320316
// to specify them with an options param? Eg. light/classic/button
321317
if (element.tagName.toLowerCase() === 'input') {
322318
Effect.wrapInput([element]);
323-
element = element.parentElement;
319+
element = element.parentNode;
324320
}
325321

326322
if ('ontouchstart' in window) {

0 commit comments

Comments
 (0)