ivirabyan / jquery-mentions

Adds mentioning support to your text fields.
http://ivirabyan.github.io/jquery-mentions/
MIT License
114 stars 49 forks source link

Add space character at the end of a mention #46

Closed amerikan closed 8 years ago

amerikan commented 8 years ago

Currently after adding a mention the cursor stays at the end of the mention text. I think it would be nice to add space after adding a mention.

For example (I'm using to denote the cursor), if I add a mention this happens `@alex, but it would be better for it to behave this way@alex _`. Does that make sense?

I propose this because after adding a mention I find myself _always_ adding a space after to continue typing.

amerikan commented 8 years ago

@ivirabyan I was about to to implement this (I have limited coffeescript experienc), but I noticed that the .js file does not match some of the stuff in the .coffee file. Can you generate the .js from latest .coffee file and commit? Thanks!

ivirabyan commented 8 years ago

It's a nice feature, but it must be optional (although true by default).

ivirabyan commented 8 years ago

Now you can pass option suffix: " " to automatically add a space after mention

amerikan commented 8 years ago

I downloaded v1.0.3 from releases (https://github.com/ivirabyan/jquery-mentions/releases/tag/1.0.3), however, this feature was not on there. Did you forget to compile the .coffee? Or will there be a different release for it?

If I grabbed the .js from the master branch (https://github.com/ivirabyan/jquery-mentions/blob/master/jquery.mentions.js), it works. Something is out of sync?

ivirabyan commented 8 years ago

I made v1.0.4 release which includes this feature