File tree 2 files changed +8
-3
lines changed
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
## Upcoming
2
2
3
- * Fix ` FieldView ` focus getting lost on clicking the ` OptionsView ` on non-mobile platforms.
3
+ * Fixed ` FieldView ` focus getting lost on clicking the ` OptionsView ` on non-mobile platforms.
4
+ * Fixed ` RangeError ` when ` textEditingValue.selection.isInvalid ` . [ #11 ] ( https://github.com/xsahil03x/multi_trigger_autocomplete/issues/11 )
4
5
5
6
## 0.1.1
6
7
7
- * Fix Readme.
8
+ * Fixed Readme.
8
9
9
10
## 0.1.0
10
11
Original file line number Diff line number Diff line change @@ -62,7 +62,11 @@ class AutocompleteTrigger {
62
62
/// the autocomplete query if so.
63
63
AutocompleteQuery ? invokingTrigger (TextEditingValue textEditingValue) {
64
64
final text = textEditingValue.text;
65
- final cursorPosition = textEditingValue.selection.baseOffset;
65
+ final selection = textEditingValue.selection;
66
+
67
+ // If the selection is invalid, then it's not a trigger.
68
+ if (! selection.isValid) return null ;
69
+ final cursorPosition = selection.baseOffset;
66
70
67
71
// Find the first [trigger] location before the input cursor.
68
72
final firstTriggerIndexBeforeCursor =
You can’t perform that action at this time.
0 commit comments