Prevent compare results from closing when selecting a school
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 58s

- Added stopPropagation to result item click handler
- Window now stays open when adding schools to comparison
- Only closes when clicking outside or using close button/ESC
This commit is contained in:
Tudor Sitaru
2026-01-06 22:50:14 +00:00
parent 0c425bd503
commit e20779ab9f

View File

@@ -1226,7 +1226,8 @@ function setupEventListeners() {
elements.compareResults
.querySelectorAll(".compare-result-item")
.forEach((item) => {
item.addEventListener("click", () => {
item.addEventListener("click", (e) => {
e.stopPropagation(); // Prevent click-outside handler from closing results
const urn = parseInt(item.dataset.urn);
const school = data.schools.find((s) => s.urn === urn);
if (school) {