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

Commit d4dd664

Browse files
committed
member type
1 parent 8b96296 commit d4dd664

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/packages/members/member-type/components/input-member-type/input-member-type.element.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import { UmbMemberTypePickerContext } from './input-member-type.context.js';
22
import { css, html, customElement, property, state, repeat, when } from '@umbraco-cms/backoffice/external/lit';
33
import { splitStringToArray } from '@umbraco-cms/backoffice/utils';
4-
import { UUIFormControlMixin } from '@umbraco-cms/backoffice/external/uui';
54
import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element';
65
import type { UmbUniqueItemModel } from '@umbraco-cms/backoffice/models';
6+
import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation';
77

88
@customElement('umb-input-member-type')
9-
export class UmbInputMemberTypeElement extends UUIFormControlMixin(UmbLitElement, '') {
9+
export class UmbInputMemberTypeElement extends UmbFormControlMixin<string | undefined, typeof UmbLitElement>(
10+
UmbLitElement,
11+
) {
1012
/**
1113
* This is a minimum amount of selected items in this input.
1214
* @type {number}
@@ -60,13 +62,12 @@ export class UmbInputMemberTypeElement extends UUIFormControlMixin(UmbLitElement
6062
return this.#pickerContext.getSelection();
6163
}
6264

63-
@property()
64-
public set value(idsString: string) {
65-
// Its with full purpose we don't call super.value, as thats being handled by the observation of the context selection. [NL]
66-
this.selection = splitStringToArray(idsString);
65+
@property({ type: String })
66+
public set value(selectionString: string | undefined) {
67+
this.selection = splitStringToArray(selectionString);
6768
}
68-
public get value(): string {
69-
return this.selection.join(',');
69+
public get value(): string | undefined {
70+
return this.selection.length > 0 ? this.selection.join(',') : undefined;
7071
}
7172

7273
@state()

0 commit comments

Comments
 (0)