remove broken connections

This commit is contained in:
“chrisshank” 2024-10-23 11:43:06 -07:00
parent dc1b389428
commit c0dd007495
1 changed files with 6 additions and 0 deletions

View File

@ -33,6 +33,12 @@ class SpatialThought extends HTMLElement {
handleEvent(event: PointerEvent): void {
if (event.type === 'click' && event.target === this.#deleteButton) {
this.#geometry.remove();
document
.querySelectorAll(
`spatial-connection[source="spatial-geometry[id='${this.#geometry.id}']"],
spatial-connection[target="spatial-geometry[id='${this.#geometry.id}']"]`
)
.forEach((el) => el.remove());
}
}
}