Skip to content

Commit

Permalink
Fix: support IE 11
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Press committed Nov 27, 2018
1 parent 14f5da6 commit 91922c1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/doc/DocAnnotator.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,11 @@ class DocAnnotator extends Annotator {
onSelectionChange(event: Event) {
const selection = window.getSelection();
const selectionNode = selection.anchorNode;
if (!this.annotatedElement.contains(selectionNode)) {
// Check parent node in IE, which will return a text node instead of a div when accessing the anchorNode
if (
!this.annotatedElement.contains(selectionNode) ||
!this.annotatedElement.contains(selectionNode.parentNode)
) {
return;
}
Expand Down

0 comments on commit 91922c1

Please sign in to comment.