fritx / vue-at

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

Selecting an option does not add it immediately to v-model's textarea #100

Open gusMoreno opened 5 years ago

gusMoreno commented 5 years ago

Hi,

My application has a chat, and I am using at-textarea to select tags and users. I based my code in the demonstration available in the FAQ page.

Here is my code: Captura de Tela 2019-05-14 às 12 52 35

The issue is that when I select an option, the option is not added immediately to the v-model newMessage. It even shows in the textarea, but it only gets added to newMessage if/when I type anything else.

The gif below demonstrates the issue. There is a console.log that prints the value of newMessage, every time it changes. vue-at gif

How can I fix this?

Thanks in advance!

fritx commented 5 years ago

@gusMoreno try v-model on <at-ta> instead of <textarea>, see readme: https://github.com/fritx/vue-at#using-v-model-recommended docs: https://fritx.github.io/vue-at/#/en/vmodel

gusMoreno commented 5 years ago

@fritx Thanks for replying!

I tried everything in the docs. Doing it does not update the newMessage value. I even removed one of the <at> components, as per code below, but it does not work:

Captura de Tela 2019-05-16 às 09 06 57

Here is a gif, showing that even though the textarea is changing, the newMessage is always equals an empty string.

gif2

gusMoreno commented 5 years ago

@fritx Is there a workaround to this issue? I can provide more documentation if necessary.

fritx commented 5 years ago

@gusMoreno is there any third-party library that processes the textarea? like https://github.com/fritx/vue-at#used-with-3rd-party-libraries

It should be working if you at least use the latest version of vue-at, 2.5.0-beta.2, try it plz

gusMoreno commented 5 years ago

@fritx It was not a third-party library, just a regular textarea. It worked after upgrading the vue-at version to 2.5.0-beta.2

Thank you, I really appreciate your support, and the work you are doing with vue-at!!

zisan34 commented 3 years ago

Still having this issue. Exactly the same as @gusMoreno for me this didn't solve by moving to 2.5.0-beta.2 https://prnt.sc/ui1w4r

the data is entered to v-model after the user hits another key after selecting the mention. For example, if I select a mention then make another keypress then it works. Otherwise doesn't. https://prnt.sc/ui1va4