From d675177eef03531812a2fb07298a0b15527a6056 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Tue, 2 Mar 2021 10:46:03 +0100 Subject: [PATCH] Never let the cursor go < 0 Fixes APP-WX --- lib/editors/common.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/editors/common.dart b/lib/editors/common.dart index 8cfc3be4..106f0d05 100644 --- a/lib/editors/common.dart +++ b/lib/editors/common.dart @@ -36,6 +36,10 @@ class TextEditorState { TextEditorState.fromValue(TextEditingValue val) { text = val.text; cursorPos = val.selection.baseOffset; + + if (cursorPos == -1) { + cursorPos = 0; + } } TextEditingValue toValue() {