From 275b057b40484218f5218555d53db22d422a6b13 Mon Sep 17 00:00:00 2001 From: Adam Doan Date: Wed, 21 Jun 2023 17:37:22 +0000 Subject: [PATCH 1/2] Add the ability to expand / collapse via keyboard --- .../dynamic-scrollable-dropdown.component.html | 2 +- .../dynamic-scrollable-dropdown.component.ts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) 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 3a75fe1037..6e2d29b789 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 @@ -23,7 +23,7 @@ (blur)="onBlur($event)" (click)="$event.stopPropagation(); openDropdown(sdRef);" (focus)="onFocus($event)" - (keypress)="$event.preventDefault()"> + (keydown)="selectOnKeyDown($event, sdRef)">
Date: Thu, 22 Jun 2023 12:14:15 +0200 Subject: [PATCH 2/2] [DURACOM-170] Fixed "add collection" behavior --- .../collection-form/collection-form.component.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/collection-page/collection-form/collection-form.component.ts b/src/app/collection-page/collection-form/collection-form.component.ts index 84223d260a..ebb03df3b9 100644 --- a/src/app/collection-page/collection-form/collection-form.component.ts +++ b/src/app/collection-page/collection-form/collection-form.component.ts @@ -22,6 +22,8 @@ import { MetadataValue } from '../../core/shared/metadata.models'; import { getFirstSucceededRemoteListPayload } from '../../core/shared/operators'; import { collectionFormEntityTypeSelectionConfig, collectionFormModels, } from './collection-form.models'; import { NONE_ENTITY_TYPE } from '../../core/shared/item-relationships/item-type.resource-type'; +import { hasNoValue, isNotNull } from 'src/app/shared/empty.util'; + /** * Form used for creating and editing collections @@ -66,6 +68,12 @@ export class CollectionFormComponent extends ComColFormComponent imp super(formService, translate, notificationsService, authService, requestService, objectCache); } + ngOnInit(): void { + if (hasNoValue(this.formModel) && isNotNull(this.dso)) { + this.initializeForm(); + } + } + /** * Detect changes to the dso and initialize the form, * if the dso changes, exists and it is not the first change