Skip to content

Conversation

@xiaoliyooo
Copy link
Contributor

Related issue: #29660

I found that fixing this issue caused an edge issue where deleting a 2D object when its children contain non-2D objects would cause an error because its children did not have an element attribute, I think this should be added, although I'm not sure if this is the correct hierarchy.

@Mugen87
Copy link
Collaborator

Mugen87 commented Sep 15, 2025

Can you also update CSS3Renderer in the same way?

this.addEventListener( 'removed', function () {
this.traverse( function ( object ) {
if (
object.element instanceof object.element.ownerDocument.defaultView.Element &&
object.element.parentNode !== null
) {
object.element.remove();
}
} );
} );
}

This change makes indeed the renderer more robust.

@Mugen87 Mugen87 added this to the r181 milestone Sep 15, 2025
@xiaoliyooo
Copy link
Contributor Author

Can you also update CSS3Renderer in the same way?你也可以用同样的方式更新 CSS3Renderer 吗?

this.addEventListener( 'removed', function () {
this.traverse( function ( object ) {
if (
object.element instanceof object.element.ownerDocument.defaultView.Element &&
object.element.parentNode !== null
) {
object.element.remove();
}
} );
} );
}

This change makes indeed the renderer more robust.这一变化确实使渲染器更加健壮。

Okay, I'll add it on later!

@xiaoliyooo
Copy link
Contributor Author

Can you also update CSS3Renderer in the same way?

this.addEventListener( 'removed', function () {
this.traverse( function ( object ) {
if (
object.element instanceof object.element.ownerDocument.defaultView.Element &&
object.element.parentNode !== null
) {
object.element.remove();
}
} );
} );
}

This change makes indeed the renderer more robust.

Added😀!

@Mugen87 Mugen87 merged commit f25b5a6 into mrdoob:dev Sep 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants