Skip to content

Commit 8b09892

Browse files
authored
Merge pull request #6996 from OpportunityLiu/fix/5760
fix getFullTransformMatrix in shadow DOM
2 parents 113f5c5 + 465aef4 commit 8b09892

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

draftlogs/6996_fix.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Fix `getFullTransformMatrix` in shadow DOM [[#6996](https://github.com/plotly/plotly.js/pull/6996)],
2+
with thanks to @OpportunityLiu for the contribution!

src/lib/dom.js

+3
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,9 @@ function getElementAndAncestors(element) {
134134
while(isTransformableElement(element)) {
135135
allElements.push(element);
136136
element = element.parentNode;
137+
if(typeof ShadowRoot === 'function' && element instanceof ShadowRoot) {
138+
element = element.host;
139+
}
137140
}
138141
return allElements;
139142
}

0 commit comments

Comments
 (0)