From 20de548763099115e884a853041d2a35aedaed10 Mon Sep 17 00:00:00 2001 From: Mikkel Date: Tue, 7 Feb 2023 14:10:27 +0100 Subject: [PATCH] fix searchbar error --- frontend/src/main.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() {