diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 8ea332d..1710768 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -105,7 +105,7 @@ function setupSearchBar(zipCodeElement: HTMLParagraphElement) { searchBar.onkeypress = (event: KeyboardEvent) => {console.log(event); event.key !== "Enter" || !isNaN(parseInt(event.key));} - searchBar.onsubmit = async (event: MouseEvent) => { + searchBar.addEventListener("submit", async (event: MouseEvent) => { event.preventDefault(); const inputValue = searchInput.value; @@ -122,7 +122,7 @@ function setupSearchBar(zipCodeElement: HTMLParagraphElement) { data.length ? data[0]["navn"] : null, ); - }; + }); } function main() {