fix: readonly codemirror fields don't trigger IMEs

This commit is contained in:
Andrew Bastin
2022-04-01 13:27:17 +05:30
parent c891d1ff9d
commit f027d2dd23

View File

@@ -225,6 +225,11 @@ export function useCodemirror(
}
}
),
EditorView.updateListener.of((update) => {
if (options.extendedEditorConfig.readOnly) {
update.view.contentDOM.inputMode = "none"
}
}),
EditorState.changeFilter.of(() => !options.extendedEditorConfig.readOnly),
placeholderConfig.of(
placeholder(options.extendedEditorConfig.placeholder ?? "")