Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

event when user press @ #102

Open
faraztanveer opened this issue Jul 10, 2019 · 2 comments
Open

event when user press @ #102

faraztanveer opened this issue Jul 10, 2019 · 2 comments

Comments

@faraztanveer
Copy link

An event when user press '@'. I want to get members list from server side so when user press @ i will update the list of members.
i tried @at event as explained in this issue #16 but this event triggers whenever key is pressed.

Example:
**when "hello @username" is entered. event should trigger when @ is pressed and i get 'username' value only, not hello @username **

@fritx
Copy link
Owner

fritx commented Jul 12, 2019

@faraztanveer hey which version of vue-at do you use?

I could not reproduce it on my side (vue-at 2.5.0-beta.2),
but you can also try passing <at :allow-spaces="false">,
that would avoid allowing spaces included in the chunk like

# input
Hello @name foo bar

# emits
- @at chunk='n'
- @at chunk='na'
- @at chunk='nam'
- @at chunk='name'

# while with the default prop allow-spaces=true
- ...
- @at chunk='name'
- @at chunk='name '
- @at chunk='name f'
- @at chunk='name fo'
- @at chunk='name foo'
- @at chunk='name foo '
- @at chunk='name foo b'
- ...

PS: each of the above event would be triggered once or twice, which could be improved

@faraztanveer
Copy link
Author

@fritx thank you 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants