From feb1991da360587a4cb97b615be9ff5c43c47b00 Mon Sep 17 00:00:00 2001 From: liyasthomas Date: Mon, 15 Nov 2021 16:43:10 +0530 Subject: [PATCH] fix: error on updating readonly editor --- packages/hoppscotch-app/helpers/editor/codemirror.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/hoppscotch-app/helpers/editor/codemirror.ts b/packages/hoppscotch-app/helpers/editor/codemirror.ts index dce9998c4..381668559 100644 --- a/packages/hoppscotch-app/helpers/editor/codemirror.ts +++ b/packages/hoppscotch-app/helpers/editor/codemirror.ts @@ -197,7 +197,8 @@ export function useCodemirror( cachedValue.value = update.state.doc .toJSON() .join(update.state.lineBreak) - value.value = cachedValue.value + if (!options.extendedEditorConfig.readOnly) + value.value = cachedValue.value } } } @@ -248,6 +249,7 @@ export function useCodemirror( watch(value, (newVal) => { if (cachedValue.value !== newVal) { view.value?.dispatch({ + filter: false, changes: { from: 0, to: view.value.state.doc.length,