aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/adopter.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/adopter.js')
-rw-r--r--src/utils/adopter.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils/adopter.js b/src/utils/adopter.js
index 30eab84..b016837 100644
--- a/src/utils/adopter.js
+++ b/src/utils/adopter.js
@@ -29,13 +29,15 @@ export function makeInstance (element, isHTML = false) {
}
// Make sure, that HTML elements are created with the correct namespace
- var node = isHTML ? globals.document.createElement('div') : create('svg')
- node.innerHTML = element
+ var wrapper = isHTML ? globals.document.createElement('div') : create('svg')
+ wrapper.innerHTML = element
// We can use firstChild here because we know,
// that the first char is < and thus an element
- element = adopter(node.firstChild)
+ element = adopter(wrapper.firstChild)
+ // make sure, that element doesnt have its wrapper attached
+ wrapper.removeChild(wrapper.firstChild)
return element
}