diff --git a/playground/src/pages/misc/HTMLDemo.vue b/playground/src/pages/misc/HTMLDemo.vue
index 32f01c26..5e4ed195 100644
--- a/playground/src/pages/misc/HTMLDemo.vue
+++ b/playground/src/pages/misc/HTMLDemo.vue
@@ -24,19 +24,17 @@ const state = reactive({
center: true,
})
-function onOcclude(ev) {
- console.log('occluded', ev)
-}
+const isActive = ref(false)
-
-
+
-
+
Box
@@ -58,8 +59,9 @@ function onOcclude(ev) {
-
+
Sphere
diff --git a/src/core/misc/HTML.vue b/src/core/misc/HTML.vue
deleted file mode 100644
index f8b19a02..00000000
--- a/src/core/misc/HTML.vue
+++ /dev/null
@@ -1,518 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/core/misc/html/HTML.vue b/src/core/misc/html/HTML.vue
index 47280236..be3cbfe9 100644
--- a/src/core/misc/html/HTML.vue
+++ b/src/core/misc/html/HTML.vue
@@ -168,7 +168,7 @@ watch(
)
watch(
- () => [groupRef.value, renderer.value, sizes.width.value, sizes.height.value],
+ () => [groupRef.value, renderer.value, sizes.width.value, sizes.height.value, slots.default?.()],
([group, _renderer]: [TresObject3D | null, WebGLRenderer]): void => {
if (group && _renderer) {
const target = portal?.value || _renderer.domElement
@@ -193,12 +193,22 @@ watch(
if (transform.value) {
vnode.value = createVNode('div', { id: 'outer', style: styles.value }, [
createVNode('div', { id: 'inner', style: transformInnerStyles.value }, [
- createVNode('div', { id: scene?.value.uuid, class: attrs.class, style: attrs.style }, slots.default?.()),
+ createVNode('div', {
+ key: meshRef.value?.uuid,
+ id: scene?.value.uuid,
+ class: attrs.class,
+ style: attrs.style,
+ }, slots.default?.()),
]),
])
}
else {
- vnode.value = createVNode('div', { id: scene?.value.uuid, style: styles.value }, slots.default?.())
+ vnode.value = createVNode('div', {
+ key: meshRef.value?.uuid,
+ id: scene?.value.uuid,
+ style: styles.value,
+ },
+ slots.default?.())
}
render(vnode.value, el.value)
}