Skip to content

Commit

Permalink
fix: #142 cannot select contents in readOnly text mode
Browse files Browse the repository at this point in the history
  • Loading branch information
josdejong committed Apr 17, 2023
1 parent 5e5494f commit 99922dc
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/lib/components/modes/textmode/TextMode.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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() })),
Expand Down Expand Up @@ -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))]
})
}
}
Expand Down

0 comments on commit 99922dc

Please sign in to comment.