Add click-outside handler to close compare search results
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 55s
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 55s
This commit is contained in:
@@ -1280,6 +1280,22 @@ function setupEventListeners() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Close compare results when clicking outside
|
||||||
|
document.addEventListener("click", (e) => {
|
||||||
|
if (!elements.compareResults.classList.contains("active")) return;
|
||||||
|
|
||||||
|
// Don't close if clicking inside the search input or results
|
||||||
|
if (
|
||||||
|
elements.compareSearch.contains(e.target) ||
|
||||||
|
elements.compareResults.contains(e.target)
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close the results
|
||||||
|
elements.compareResults.classList.remove("active");
|
||||||
|
});
|
||||||
|
|
||||||
// Metric selector
|
// Metric selector
|
||||||
elements.metricSelect.addEventListener("change", updateComparisonChart);
|
elements.metricSelect.addEventListener("change", updateComparisonChart);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user