add readonly mode

This commit is contained in:
Mads Rasmussen
2024-06-21 11:59:02 +02:00
parent e19bcea476
commit 2793a72ca7

View File

@@ -11,6 +11,15 @@ export class UmbPropertyEditorUITextareaElement extends UmbLitElement implements
@property()
value = '';
/**
* 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;
@state()
private _maxChars?: number;
@@ -52,7 +61,8 @@ export class UmbPropertyEditorUITextareaElement extends UmbLitElement implements
.maxlength=${this._maxChars}
.rows=${this._rows}
.value=${this.value ?? ''}
@input=${this.#onInput}></uui-textarea>
@input=${this.#onInput}
?readonly=${this.readonly}></uui-textarea>
`;
}