fritx / vue-at

At.js for Vue.
https://fritx.github.io/vue-at/
MIT License
529 stars 114 forks source link

Don't add space if the autocomplete ends with column (or specified char) #24

Closed pingshunhuangalex closed 6 years ago

pingshunhuangalex commented 6 years ago

Hi @fritx

Just wonder if it's possible to not add space if the autocomplete ends with column (or even better with specified char), something to do with this line https://github.com/fritx/vue-at/blob/dev/src/At.vue#L281

fritx commented 6 years ago

@pingshunhuangalex oh, do you mean when insert @peter before a :, it should not insert the trailing space?

But I just test on the github comment textarea, seems it puts the space every time?

fritx commented 6 years ago

I agree the "space" should be configurable. xD

pingshunhuangalex commented 6 years ago

@fritx I'm talking about having a toggle switch that stops the plugin from adding a space upon autocomplete. For example, I'm using this package as some kind of a search where I set @ext: as the autocomplete item.

At the moment, it'll add a space every time I press enter or select the item which can be annoying sometimes. Just wondering if there's a way to suppress this. Thanks.

fritx commented 6 years ago

But if you try github comment-box behavior, I'm afraid not inserting a trailing space or something could lead to other concerns, such as deleting a matched item and suggestions remaining after inserted.

See the commit referenced above.

pingshunhuangalex commented 6 years ago

I get it if it's a @user kind of use case, but in my case, I'm trying to make it into some kind of search autocomplete like what Google does, e.g. site:xxx, but you are right, this is too specific of a change for a general @package, I'll working out something myself. Thanks.