File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,9 @@ export default class DOMStylesReader {
2121 */
2222 this . dummyNode = undefined
2323
24+ // used to check if the dummyNode is on the current targetNode
25+ this . targetNode = undefined
26+
2427 /**
2528 * Set to true once tokenized
2629 * @access private
@@ -99,12 +102,13 @@ export default class DOMStylesReader {
99102 * @access private
100103 */
101104 ensureDummyNodeExistence ( targetNode ) {
102- if ( this . dummyNode === undefined ) {
105+ if ( this . targetNode !== targetNode || this . dummyNode === undefined ) {
103106 this . dummyNode = document . createElement ( 'span' )
104107 this . dummyNode . style . visibility = 'hidden'
105108
106109 // attach to the target node
107110 targetNode . appendChild ( this . dummyNode )
111+ this . targetNode = targetNode
108112 }
109113 }
110114
You can’t perform that action at this time.
0 commit comments