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() {