From 8a20a68e8ea20931de0255eea185e735c5d2913a Mon Sep 17 00:00:00 2001 From: carly-goodandbeautiful <127149340+carly-goodandbeautiful@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:08:21 -0600 Subject: [PATCH] Fixed tab editing when in readOnly mode (#1433) --- lib/src/widgets/raw_editor.dart | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/src/widgets/raw_editor.dart b/lib/src/widgets/raw_editor.dart index b4d814fe..15483c88 100644 --- a/lib/src/widgets/raw_editor.dart +++ b/lib/src/widgets/raw_editor.dart @@ -757,6 +757,9 @@ class RawEditorState extends EditorState controller.document.queryChild(controller.selection.baseOffset); KeyEventResult insertTabCharacter() { + if (widget.readOnly) { + return KeyEventResult.ignored; + } controller.replaceText(controller.selection.baseOffset, 0, '\t', null); _moveCursor(1); return KeyEventResult.handled;