From cbacd14142916b82fb21b2b4ee41c62b0d772081 Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Mon, 26 Aug 2024 14:44:13 +0200 Subject: [PATCH] pass readonly to input --- .../property-editor-ui-markdown-editor.element.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/markdown-editor/property-editors/markdown-editor/property-editor-ui-markdown-editor.element.ts b/src/Umbraco.Web.UI.Client/src/packages/markdown-editor/property-editors/markdown-editor/property-editor-ui-markdown-editor.element.ts index e4d0e93692..8383d5f090 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/markdown-editor/property-editors/markdown-editor/property-editor-ui-markdown-editor.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/markdown-editor/property-editors/markdown-editor/property-editor-ui-markdown-editor.element.ts @@ -17,6 +17,15 @@ export class UmbPropertyEditorUIMarkdownEditorElement extends UmbLitElement impl @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 _preview?: boolean; @@ -41,7 +50,8 @@ export class UmbPropertyEditorUIMarkdownEditorElement extends UmbLitElement impl value=${this.value} .overlaySize=${this._overlaySize} ?preview=${this._preview} - @change=${this.#onChange}> + @change=${this.#onChange} + ?readonly=${this.readonly}> `; } }