Skip to content

Commit 8915267

Browse files
committed
Prevent 0 length strings from triggering completions. Close #94. Close #96.
1 parent 9577c5c commit 8915267

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,8 @@ public boolean enoughToFilter() {
397397
start = prefix.length();
398398
}
399399

400-
return end - start >= getThreshold();
400+
//Don't allow 0 length entries to filter
401+
return end - start >= Math.max(getThreshold(), 1);
401402
}
402403

403404
@Override

0 commit comments

Comments
 (0)