Преглед изворни кода

Merge pull request #9059 from weseek/fix/153287-input-text-becomes-empty-when-opening-the-read-only-editor

fix: Input text becomes empty when opening the ReadOnlyEditor
Shun Miyazawa пре 1 година
родитељ
комит
da9fa109b6

+ 1 - 0
packages/editor/src/client/components/CodeMirrorEditorReadOnly.tsx

@@ -13,6 +13,7 @@ const additionalExtensions: Extension[] = [
   [
     setDataLine,
     EditorState.readOnly.of(true),
+    EditorView.editable.of(false),
   ],
 ];
 

+ 1 - 1
packages/editor/src/client/stores/codemirror-editor.ts

@@ -33,7 +33,7 @@ export const useCodeMirrorEditorIsolated = (
 
   const newData = useCodeMirrorEditor(mergedProps);
 
-  const shouldUpdate = swrKey != null && container != null && props != null && (
+  const shouldUpdate = swrKey != null && container != null && (
     currentData == null
     || (isValid(newData) && !isDeepEquals(currentData, newData))
   );