Skip to content

Commit

Permalink
Prevent enter in the edit measure modal
Browse files Browse the repository at this point in the history
  • Loading branch information
laurensWe committed Dec 17, 2024
1 parent 203c26e commit 0891a32
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 12 additions & 0 deletions amt/site/static/ts/amt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});
}
3 changes: 2 additions & 1 deletion amt/site/templates/algorithms/details_measure_modal.html.j2
Original file line number Diff line number Diff line change
Expand Up @@ -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">
<div class="utrecht-form-fieldset rvo-form-fieldset rvo-layout-gap--0">
<fieldset class="utrecht-form-fieldset__fieldset utrecht-form-fieldset--html-fieldset">
<div role="group"
Expand Down

0 comments on commit 0891a32

Please sign in to comment.