DocumentPicker: Added value handling for legacy/migrated data

If the input `value` is a `string`, then we can handle that as an `string[]`
This commit is contained in:
leekelleher
2024-02-29 18:33:54 +00:00
parent b44ed87ea6
commit 003cae9ae2
2 changed files with 2 additions and 2 deletions

View File

@@ -163,7 +163,7 @@ export class UmbInputDocumentElement extends FormControlMixin(UmbLitElement) {
}
#renderItems() {
if (!this._items) return;
if (!this._items?.length) return;
return html`<uui-ref-list>
${repeat(
this._items,

View File

@@ -13,7 +13,7 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl
return this._value;
}
public set value(value: Array<string>) {
this._value = value || [];
this._value = Array.isArray(value) ? value : value ? [value] : [];
}
@property({ attribute: false })