From f027d2dd2353631428caf9156c537c6244d721b1 Mon Sep 17 00:00:00 2001 From: Andrew Bastin Date: Fri, 1 Apr 2022 13:27:17 +0530 Subject: [PATCH] fix: readonly codemirror fields don't trigger IMEs --- packages/hoppscotch-app/helpers/editor/codemirror.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/hoppscotch-app/helpers/editor/codemirror.ts b/packages/hoppscotch-app/helpers/editor/codemirror.ts index 9f2b1a7ee..fd7b25c1d 100644 --- a/packages/hoppscotch-app/helpers/editor/codemirror.ts +++ b/packages/hoppscotch-app/helpers/editor/codemirror.ts @@ -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 ?? "")