From 086c8b64228023ced639b37b32c01fbbc23ca69e Mon Sep 17 00:00:00 2001 From: leekelleher Date: Thu, 23 May 2024 10:34:37 +0100 Subject: [PATCH] Bugfix: Document Picker: Ensures max=1 This is to support the legacy data format of the Content Picker, as the backend will only accept a single `Guid` (`string`) value, not a comma-separated string. --- .../property-editor-ui-document-picker.element.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.ts b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.ts index a3a845253e..cf4793ae28 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/documents/documents/property-editors/document-picker/property-editor-ui-document-picker.element.ts @@ -19,7 +19,7 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl const minMax = config.getValueByAlias('validationLimit'); if (minMax) { this._min = minMax.min && minMax.min > 0 ? minMax.min : 0; - this._max = minMax.max && minMax.max > 0 ? minMax.max : Infinity; + this._max = minMax.max && minMax.max > 0 ? minMax.max : 1; } this._startNodeId = config.getValueByAlias('startNodeId'); @@ -29,8 +29,10 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl @state() private _min = 0; + // NOTE: The legacy "Content Picker" property-editor only supported 1 item, + // so that's why it's being enforced here. We'll evolve this in a future version. [LK] @state() - private _max = Infinity; + private _max = 1; @state() private _startNodeId?: string;