Skip to content

Commit 9077e80

Browse files
Merge pull request #2028 from umbraco/v14/feature/umb-property-editor-ui-textarea-readonly-mode
Feature: Readonly mode for Text Area Property Editor UI
2 parents 3798f24 + 54a5ca5 commit 9077e80

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/packages/property-editors/textarea/property-editor-ui-textarea.element.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ export class UmbPropertyEditorUITextareaElement extends UmbLitElement implements
1111
@property()
1212
value = '';
1313

14+
/**
15+
* Sets the input to readonly mode, meaning value cannot be changed but still able to read and select its content.
16+
* @type {boolean}
17+
* @attr
18+
* @default false
19+
*/
20+
@property({ type: Boolean, reflect: true })
21+
readonly = false;
22+
1423
@state()
1524
private _maxChars?: number;
1625

@@ -52,7 +61,8 @@ export class UmbPropertyEditorUITextareaElement extends UmbLitElement implements
5261
.maxlength=${this._maxChars}
5362
.rows=${this._rows}
5463
.value=${this.value ?? ''}
55-
@input=${this.#onInput}></uui-textarea>
64+
@input=${this.#onInput}
65+
?readonly=${this.readonly}></uui-textarea>
5666
`;
5767
}
5868

0 commit comments

Comments
 (0)