From ed4e794d466cec87ec9f7029f59165ff12409174 Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Wed, 4 Dec 2024 17:16:14 +0100 Subject: [PATCH 1/2] 119799: Prevent submission from updating the dropdown values when hitting enter in another input form (onsubmit) --- .../dynamic-scrollable-dropdown.component.html | 6 ++++-- src/app/shared/form/form.service.ts | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html index 6e2d29b7893..96fb78c0aa9 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/scrollable-dropdown/dynamic-scrollable-dropdown.component.html @@ -41,10 +41,12 @@ (scrolled)="onScroll()" [scrollWindow]="false"> - + diff --git a/src/app/shared/form/form.service.ts b/src/app/shared/form/form.service.ts index bf316daaed3..e6c3776a422 100644 --- a/src/app/shared/form/form.service.ts +++ b/src/app/shared/form/form.service.ts @@ -130,6 +130,9 @@ export class FormService { } public addControlErrors(field: AbstractControl, formId: string, fieldId: string, fieldIndex: number) { + if (field.errors === null) { + return; + } const errors: string[] = Object.keys(field.errors) .filter((errorKey) => field.errors[errorKey] === true) .map((errorKey) => `error.validation.${errorKey}`); From c8694e1a87ab6ad70ef0f984a77f3e12dbd5605d Mon Sep 17 00:00:00 2001 From: Alexandre Vryghem Date: Sat, 7 Dec 2024 20:58:52 +0100 Subject: [PATCH 2/2] 119799: Prevent the lookup/lookup-name fields from resetting when hitting the enter key in another input field --- .../models/lookup/dynamic-lookup.component.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.html b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.html index 89e7af9aa67..79f2756b249 100644 --- a/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.html +++ b/src/app/shared/form/builder/ds-dynamic-form-ui/models/lookup/dynamic-lookup.component.html @@ -94,11 +94,12 @@ (scrolled)="onScroll()" [scrollWindow]="false"> - -