Merge pull request #1872 from umbraco/bugfix/property-editor-ui/document-picker-max1

Bugfix: Document Picker: Ensures `max = 1`
This commit is contained in:
Lee Kelleher
2024-05-23 12:01:44 +01:00
committed by GitHub

View File

@@ -19,7 +19,7 @@ export class UmbPropertyEditorUIDocumentPickerElement extends UmbLitElement impl
const minMax = config.getValueByAlias<NumberRangeValueType>('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;