www.spaceplanner.app

Web client to the spaceplanner API
git clone git://jacobedwards.org/www.spaceplanner.app
Log | Files | Refs

commit 8a7b6466cbd98d6fda87bf668b3a600d10833f8f
parent 49d05a821d0d8824c83ef38e75ebae3a3f4a6cae
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date:   Mon, 16 Sep 2024 12:45:17 -0700

Fix mutation observer using undefined classList object

I'm not entirely sure why, but for some elements the classList
object was not defined. I'm sure it's not a bug, but I figure if
it doesn't have a classList it's not something that can be selected.

Diffstat:
Mfiles/floorplans/floorplan/editor.js | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/files/floorplans/floorplan/editor.js b/files/floorplans/floorplan/editor.js @@ -309,7 +309,7 @@ export class FloorplanEditor { for (const m of mutations) { if (m.type === "childList" && m.removedNodes) { m.removedNodes.forEach(function(node) { - if (node.classList.contains("selected")) { + if (node.classList && node.classList.contains("selected")) { console.debug("selectionRemoval", "Detected selected node being removed") editor.draw.reselect()