fix searchbar error

This commit is contained in:
Mikkel 2023-02-07 14:10:27 +01:00
parent bf4906b353
commit 20de548763

View File

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