Skip to content

Commit

Permalink
Update TributeRange.js (#77)
Browse files Browse the repository at this point in the history
Replace `this.getDocument().activeElement` with `this.tribute.current.element` to fix a bug in shadow DOM, where the menu could not be shown. Because `this.getDocument().activeElement` was not the native input element.
  • Loading branch information
BorntraegerMarc authored and mrsweaters committed Sep 3, 2017
1 parent a1e32c5 commit 0afb6f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TributeRange.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class TributeRange {
text = ''

if (!this.isContentEditable(context.element)) {
let textComponent = this.getDocument().activeElement
let textComponent = this.tribute.current.element;
if (textComponent) {
let startPos = textComponent.selectionStart
if (textComponent.value && startPos >= 0) {
Expand Down

0 comments on commit 0afb6f4

Please sign in to comment.