diff --git a/src/Tribute.js b/src/Tribute.js index cfb06eb5..2c8e7f14 100755 --- a/src/Tribute.js +++ b/src/Tribute.js @@ -9,6 +9,7 @@ class Tribute { values = null, loadingItemTemplate = null, iframe = null, + shadowRoot = null, selectClass = "highlight", containerClass = "tribute-container", itemClass = "", @@ -58,6 +59,9 @@ class Tribute { // is it wrapped in an iframe iframe: iframe, + // is it wrapped in a web component + shadowRoot: shadowRoot, + // class applied to selected item selectClass: selectClass, diff --git a/src/TributeRange.js b/src/TributeRange.js index e0709fef..e827a8c0 100644 --- a/src/TributeRange.js +++ b/src/TributeRange.js @@ -183,6 +183,10 @@ class TributeRange { return this.tribute.collection.iframe.contentWindow.getSelection() } + if (this.tribute.collection[0].shadowRoot) { + return this.tribute.collection[0].shadowRoot.getSelection() + } + return window.getSelection() }