From a03a00c4af0e3deffb55c16c24c0a37748fae594 Mon Sep 17 00:00:00 2001 From: Mel O'Hagan Date: Fri, 3 Nov 2023 14:08:46 +0000 Subject: [PATCH] Toggle preview --- packages/bbui/src/Markdown/MarkdownEditor.svelte | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/bbui/src/Markdown/MarkdownEditor.svelte b/packages/bbui/src/Markdown/MarkdownEditor.svelte index 6c711c9d28..888187c8da 100644 --- a/packages/bbui/src/Markdown/MarkdownEditor.svelte +++ b/packages/bbui/src/Markdown/MarkdownEditor.svelte @@ -20,7 +20,9 @@ // control $: checkValue(value) $: mde?.codemirror.on("change", debouncedUpdate) - $: mde?.codemirror.setOption("readOnly", readonly) + $: if (readonly || disabled) { + mde?.togglePreview() + } const checkValue = val => { if (mde && val !== latestValue) {