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

Commit 49491c8

Browse files
committed
section
1 parent bc80e9d commit 49491c8

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/packages/core/section/components/input-section/input-section.element.ts

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

88
@customElement('umb-input-section')
9-
export class UmbInputSectionElement extends UUIFormControlMixin(UmbLitElement, '') {
9+
export class UmbInputSectionElement 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,15 +62,12 @@ export class UmbInputSectionElement extends UUIFormControlMixin(UmbLitElement, '
6062
return this.#pickerContext.getSelection();
6163
}
6264

63-
@property()
64-
public set value(selectionString: string) {
65-
// Its with full purpose we don't call super.value, as thats being handled by the observation of the context selection.
66-
if (typeof selectionString !== 'string') return;
67-
if (selectionString === this.value) return;
65+
@property({ type: String })
66+
public set value(selectionString: string | undefined) {
6867
this.selection = splitStringToArray(selectionString);
6968
}
70-
public get value(): string {
71-
return this.selection.join(',');
69+
public get value(): string | undefined {
70+
return this.selection.length > 0 ? this.selection.join(',') : undefined;
7271
}
7372

7473
@state()

0 commit comments

Comments
 (0)