From 99922dc3f5f981a742bb2a2b31151bfe1c09ecb3 Mon Sep 17 00:00:00 2001 From: Jos de Jong Date: Mon, 17 Apr 2023 17:07:28 +0200 Subject: [PATCH] fix: #142 cannot select contents in readOnly text mode --- src/lib/components/modes/textmode/TextMode.svelte | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/components/modes/textmode/TextMode.svelte b/src/lib/components/modes/textmode/TextMode.svelte index 040c2473..43df7f9e 100644 --- a/src/lib/components/modes/textmode/TextMode.svelte +++ b/src/lib/components/modes/textmode/TextMode.svelte @@ -116,7 +116,6 @@ let validationErrors: ValidationError[] = [] const linterCompartment = new Compartment() - const editableCompartment = new Compartment() // needed to prevent a mobile keyboard from opening when readonly const readOnlyCompartment = new Compartment() const indentUnitCompartment = new Compartment() const tabSizeCompartment = new Compartment() @@ -507,7 +506,6 @@ top: true }), readOnlyCompartment.of(EditorState.readOnly.of(readOnly)), - editableCompartment.of(EditorView.editable.of(!readOnly)), tabSizeCompartment.of(EditorState.tabSize.of(tabSize)), indentUnitCompartment.of(createIndentUnit(indentation)), themeCompartment.of(EditorView.theme({}, { dark: hasDarkTheme() })), @@ -697,10 +695,7 @@ debug('updateReadOnly', readOnly) codeMirrorView.dispatch({ - effects: [ - readOnlyCompartment.reconfigure(EditorState.readOnly.of(readOnly)), - editableCompartment.reconfigure(EditorView.editable.of(!readOnly)) - ] + effects: [readOnlyCompartment.reconfigure(EditorState.readOnly.of(readOnly))] }) } }