Skip to content

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

fix: error on updating readonly editor

liyasthomasfeb1991da360
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,