Skip to content

Commit c475a73

Browse files
committed
Added a space after inserted mention. Fixes #3
1 parent a60ab5c commit c475a73

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

jquery.mentionsInput.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
}
149149

150150
function addMention(mention) {
151+
151152
var currentMessage = getInputBoxValue();
152153

153154
// Using a regex to figure out positions
@@ -159,9 +160,7 @@
159160

160161
var start = currentMessage.substr(0, startCaretPosition);
161162
var end = currentMessage.substr(currentCaretPosition, currentMessage.length);
162-
var startEndIndex = (start + mention.value).length;
163-
164-
var updatedMessageText = start + mention.value + end;
163+
var startEndIndex = (start + mention.value).length + 1;
165164

166165
mentionsCollection.push(mention);
167166

@@ -171,6 +170,7 @@
171170
hideAutoComplete();
172171

173172
// Mentions & syntax message
173+
var updatedMessageText = start + mention.value + ' ' + end;
174174
elmInputBox.val(updatedMessageText);
175175
updateValues();
176176

0 commit comments

Comments
 (0)