diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 702cab7..c1e0b61 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -156,9 +156,9 @@ function setupMap( fetcher.call(async () => await fetchAndDisplayZipCode(coords)); }); - mapImg.onmouseleave = (_event: MouseEvent) => { + mapImg.addEventListener("mouseleave", (_event: MouseEvent) => { displayZipCode(zipCodeElement, null, null, null, null); - }; + }); } function setupSearchBar(zipCodeElement: HTMLParagraphElement) {