Skip to content

Commit

Permalink
fix(core/Canvas): circumvent IE 9 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Jul 16, 2018
1 parent 8f64b94 commit e1f3c65
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/core/Canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ function createGroup(parent, cls, childIndex) {

var index = childIndex !== undefined ? childIndex : parent.childNodes.length - 1;

parent.insertBefore(group, parent.childNodes[index]);
// must ensure second argument is node or _null_
// cf. https://developer.mozilla.org/en-US/docs/Web/API/Node/insertBefore
parent.insertBefore(group, parent.childNodes[index] || null);

return group;
}
Expand Down

0 comments on commit e1f3c65

Please sign in to comment.