readonly property editor ui

This commit is contained in:
Mads Rasmussen
2024-08-20 10:05:40 +02:00
parent 7133c913b0
commit 849741d358

View File

@@ -21,6 +21,15 @@ export class UmbPropertyEditorUIDropdownElement extends UmbLitElement implements
return this.#selection;
}
/**
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
* @type {boolean}
* @attr
* @default false
*/
@property({ type: Boolean, reflect: true })
readonly = false;
public set config(config: UmbPropertyEditorConfigCollection | undefined) {
if (!config) return;
@@ -80,7 +89,10 @@ export class UmbPropertyEditorUIDropdownElement extends UmbLitElement implements
#renderDropdownSingle() {
return html`
<umb-input-dropdown-list .options=${this._options} @change=${this.#onChange}></umb-input-dropdown-list>
<umb-input-dropdown-list
.options=${this._options}
@change=${this.#onChange}
?readonly=${this.readonly}></umb-input-dropdown-list>
`;
}