Skip to content

Commit 252ec34

Browse files
authored
Fix trigger char not getting removed when replaceTextSuffix is empty string (#686)
1 parent 55293f1 commit 252ec34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/TributeRange.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class TributeRange {
125125
: ' '
126126
text += textSuffix
127127
let startPos = info.mentionPosition
128-
let endPos = info.mentionPosition + info.mentionText.length + textSuffix.length
128+
let endPos = info.mentionPosition + info.mentionText.length + (textSuffix === '' ? 1 : textSuffix.length)
129129
if (!this.tribute.autocompleteMode) {
130130
endPos += info.mentionTriggerChar.length - 1
131131
}

0 commit comments

Comments
 (0)