diff --git a/amt/site/static/ts/amt.ts b/amt/site/static/ts/amt.ts index 429ed072..0a2ba86f 100644 --- a/amt/site/static/ts/amt.ts +++ b/amt/site/static/ts/amt.ts @@ -426,3 +426,15 @@ export function getFiles(element: HTMLInputElement, target_id: string) { } } } + +const form = document.getElementById( + "form-edit-measure", +) as HTMLFormElement | null; + +if (form) { + form.addEventListener("keydown", (event: KeyboardEvent) => { + if (event.key === "Enter") { + event.preventDefault(); + } + }); +} diff --git a/amt/site/templates/algorithms/details_measure_modal.html.j2 b/amt/site/templates/algorithms/details_measure_modal.html.j2 index c813fcd2..f50ef367 100644 --- a/amt/site/templates/algorithms/details_measure_modal.html.j2 +++ b/amt/site/templates/algorithms/details_measure_modal.html.j2 @@ -16,7 +16,8 @@ hx-target-error="#errorContainer" hx-swap="innerHTML" method="post" - class="rvo-layout-column rvo-layout-gap--md"> + class="rvo-layout-column rvo-layout-gap--md" + id="form-edit-measure">