From 15e5a409c1653653df4439302a16561a9c255995 Mon Sep 17 00:00:00 2001 From: EpicKiwi Date: Sat, 13 Jun 2026 14:10:39 +0200 Subject: [PATCH] ix race condition bug on highlight --- js/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/js/index.js b/js/index.js index e8fcae3..6dc7021 100644 --- a/js/index.js +++ b/js/index.js @@ -124,11 +124,13 @@ function updateActiveFeature(feature_or_featureid){ } document.getElementById("result-panel").addEventListener("activePanelChange", e => { - let activeElement = e.target.children[e.activePanelIndex] - if(activeElement instanceof FeatureElement){ - let feature = activeElement.feature - updateActiveFeature(feature) - } else { - MAP.unhighlight_all() + if(e.activePanelIndex){ + let activeElement = e.target.children[e.activePanelIndex] + if(activeElement instanceof FeatureElement){ + let feature = activeElement.feature + updateActiveFeature(feature) + } else { + MAP.unhighlight_all() + } } })