diff --git a/ts/components/CompositionInput.tsx b/ts/components/CompositionInput.tsx index 14beb79296..aca43719bb 100644 --- a/ts/components/CompositionInput.tsx +++ b/ts/components/CompositionInput.tsx @@ -140,7 +140,7 @@ function getWordAtIndex( const word = str.slice(start, end); - if (word === ':' && str.length > 1) { + if (word === ':' && index + 1 <= str.length) { return getWordAtIndex(str, index + 1); }