diff --git a/lib/src/utils/formatter/as_you_type_formatter.dart b/lib/src/utils/formatter/as_you_type_formatter.dart index 411ee6a9d1..f747fa4863 100644 --- a/lib/src/utils/formatter/as_you_type_formatter.dart +++ b/lib/src/utils/formatter/as_you_type_formatter.dart @@ -54,9 +54,9 @@ class AsYouTypeFormatter extends TextInputFormatter { newValue.selection.end == -1 ? 0 : newValue.selection.end; if (separatorChars.hasMatch(parsedText)) { - String valueInInputIndex = parsedText[offset - 1]; - if (offset < parsedText.length) { + String valueInInputIndex = parsedText[offset - 1]; + int offsetDifference = parsedText.length - offset; if (offsetDifference < 2) {