Skip to content
This repository was archived by the owner on Nov 6, 2025. It is now read-only.

Commit ea4366a

Browse files
committed
document type picker value undefined when empty
1 parent daad0fc commit ea4366a

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/packages/documents/document-types/components/input-document-type/input-document-type.element.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,13 @@ import { UmbChangeEvent } from '@umbraco-cms/backoffice/event';
88
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
99
import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router';
1010
import { UmbSorterController } from '@umbraco-cms/backoffice/sorter';
11-
import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
11+
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
1212

1313
@customElement('umb-input-document-type')
14-
export class UmbInputDocumentTypeElement extends UUIFormControlMixin(UmbLitElement, '') {
14+
export class UmbInputDocumentTypeElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
15+
UmbLitElement,
16+
undefined,
17+
) {
1518
#sorter = new UmbSorterController<string>(this, {
1619
getUniqueOfElement: (element) => {
1720
return element.id;
@@ -102,11 +105,11 @@ export class UmbInputDocumentTypeElement extends UUIFormControlMixin(UmbLitEleme
102105
}
103106

104107
@property()
105-
public set value(uniques: string) {
108+
public set value(uniques: string | undefined) {
106109
this.selection = splitStringToArray(uniques);
107110
}
108-
public get value(): string {
109-
return this.selection.join(',');
111+
public get value(): string | undefined {
112+
return this.selection.length > 0 ? this.selection.join(',') : undefined;
110113
}
111114
@state()
112115
private _items?: Array<UmbDocumentTypeItemModel>;

src/packages/documents/document-types/property-editors/document-type-picker/property-editor-ui-document-type-picker.element.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export class UmbPropertyEditorUIDocumentTypePickerElement extends UmbLitElement
3535
onlyElementTypes?: boolean;
3636

3737
#onChange(event: CustomEvent & { target: UmbInputDocumentTypeElement }) {
38-
this.value = event.target.selection.join(',');
38+
this.value = event.target.value;
3939
this.dispatchEvent(new UmbPropertyValueChangeEvent());
4040
}
4141

0 commit comments

Comments
 (0)