From 7f6745cebbe7dfefdc944c26e792ba01ec56f4ca Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 10 Jan 2025 18:04:24 +0100 Subject: [PATCH] Fix `TokenCompleteTextView`'s "prevent free-form text" behavior --- .../java/com/tokenautocomplete/TokenCompleteTextView.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/library/TokenAutoComplete/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java b/library/TokenAutoComplete/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java index 35c7abf38fb..f3950ad960d 100644 --- a/library/TokenAutoComplete/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java +++ b/library/TokenAutoComplete/src/main/java/com/tokenautocomplete/TokenCompleteTextView.java @@ -146,10 +146,8 @@ public CharSequence filter(CharSequence source, int start, int end, //Detect split characters, remove them and complete the current token instead if (tokenizer.containsTokenTerminator(source)) { - if (currentCompletionText().length() > 0) { - performCompletion(); - return ""; - } + performCompletion(); + return ""; } return null;