Skip to content

Commit

Permalink
Use node.contains instead of checking element.parentNode in mutations
Browse files Browse the repository at this point in the history
We used to check if an element had a null parent, but it is possible to
have an existing parent but still be out of dom (with a null grand*-parent)
  • Loading branch information
bantic committed Feb 9, 2016
1 parent 4aeaedb commit ea9c849
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/js/editor/mutation-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ export default class MutationHandler {
break;
}

let attachedNodes = filter(nodes, node => !!node.parentNode);
let element = this.editor.element;
let attachedNodes = filter(nodes, node => element.contains(node));
return attachedNodes;
}

Expand Down

0 comments on commit ea9c849

Please sign in to comment.