tres icon indicating copy to clipboard operation
tres copied to clipboard

comment on first line of templates affects rendering

Open BenoitBotton opened this issue 1 year ago • 2 comments

Describe the bug

a select is meant to swap between sets of objects in the scene. when the code has a comment on the first line of the template, objects are added to the scene, the old ones are not removed.

Reproduction

https://stackblitz.com/edit/tresjs-basic-hmkhgf?file=src%2Fcomponents%2FDonut.vue

Steps to reproduce

run the stackblitz. change the select to 'donuts 1', a second set of donuts is added to the scene.

delete the comment in the template (Donut.vue) and refresh the view this time when switching using the select, the scene objects are changed, not added

System Info

No response

Used Package Manager

npm

Code of Conduct

BenoitBotton avatar Jan 29 '24 18:01 BenoitBotton

Reproduction

Here's a minimal reproduction.

Maybe relevant?

For an eventual fix, it might be worth looking into /src/core/nodeOps.ts. It doesn't return a value from a createComment call.

andretchen0 avatar Apr 02 '24 00:04 andretchen0

Just tested the 4.0.2 release in your reproduction, it looks like #717 did not fix it. We'll have to do more digging into how v-for is working behind the scenes

garrlker avatar Jun 07 '24 03:06 garrlker