Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a38f736 commit fda99dfCopy full SHA for fda99df
src/clipboard-copy-element.js
@@ -14,6 +14,7 @@ function copy(button: HTMLElement) {
14
copyText(text).then(trigger)
15
} else if (id) {
16
const root = 'getRootNode' in Element.prototype ? button.getRootNode() : button.ownerDocument
17
+ if (!(root instanceof Document || ('ShadowRoot' in window && root instanceof ShadowRoot))) return
18
const node = root.getElementById(id)
19
if (node) copyTarget(node).then(trigger)
20
}
0 commit comments