From 88a7f2c79910d18e23d95de9ecffd59eabef3fe8 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 87a938bc..5c68111b 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;