diff --git a/frontend/main.ts b/frontend/main.ts index 15360e6..88bbd54 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -189,11 +189,6 @@ function selectBoatChange() { inputElement.value = formattedDateTime; - const distinput = ( - document.querySelector("#distance_in_km") - ); - distinput.value = ""; - const destinput = ( document.querySelector("#destination") ); @@ -759,9 +754,11 @@ function addRelationMagic(bodyElement: HTMLElement) { }, ); + if (option && option.value !== ""){ // Get distance const distance = option.getAttribute("distance"); - if (distance) relatedField.value = distance; + if (distance && relatedField.value === "") relatedField.value = distance; + } } }); }