From 4a5b1f4da30807df8fad78841fff78193053e668 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 13 Apr 2023 22:36:11 -0700 Subject: [PATCH] Readonly editor disable tabindex --- src-web/components/core/Editor/Editor.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src-web/components/core/Editor/Editor.tsx b/src-web/components/core/Editor/Editor.tsx index 7600640f..c9333b43 100644 --- a/src-web/components/core/Editor/Editor.tsx +++ b/src-web/components/core/Editor/Editor.tsx @@ -233,7 +233,9 @@ function getExtensions({ keymap.of(singleLine ? defaultKeymap.filter((k) => k.key !== 'Enter') : defaultKeymap), ...(singleLine ? [singleLineExt()] : []), ...(!singleLine ? [multiLineExtensions] : []), - ...(readOnly ? [EditorState.readOnly.of(true)] : []), + ...(readOnly + ? [EditorState.readOnly.of(true), EditorView.contentAttributes.of({ tabindex: '-1' })] + : []), ...(singleLine ? [ EditorView.domEventHandlers({