From 8bf898ac94c940aad3bd4f95e503b15dc2542b12 Mon Sep 17 00:00:00 2001 From: Valentin Serra Date: Wed, 27 Mar 2024 09:33:47 +0100 Subject: [PATCH] fix: make the JSON editor readonly truly readonly Closes #1107 --- packages/form-js-playground/src/components/JSONEditor.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/form-js-playground/src/components/JSONEditor.js b/packages/form-js-playground/src/components/JSONEditor.js index 72ffe881e..82ea89e1b 100644 --- a/packages/form-js-playground/src/components/JSONEditor.js +++ b/packages/form-js-playground/src/components/JSONEditor.js @@ -40,12 +40,12 @@ export function JSONEditor(options = {}) { autocompletionExtension(), keymap.of([ indentWithTab ]), editorPlaceholder ? placeholder(editorPlaceholder) : [], + EditorState.readOnly.of(readonly), EditorView.updateListener.of(update => { if (update.docChanged) { emitter.emit('changed', { value: update.state.doc.toString() }); } }), - EditorView.editable.of(!readonly), EditorView.contentAttributes.of(contentAttributes) ];