0

I have a textarea that is bound to a v-model. Upon pressing enter, I submit the textarea value and clear the model value. The problem is that after that submit function runs, I'm left with the textarea having a line break as it registers the final enter key.

I've tried binding onkeyup | key 'enter' to return false to no avail.

<textarea class="chat-input" v-model="message" 
    v-on="keydown: onSubmit(chat, $event) | key 'enter'">
</textarea>

is there a way I can prevent the line break from occurring after my submit function runs?

1
  • 1
    Have you tried calling event.preventDefault()? Commented Aug 27, 2015 at 16:23

1 Answer 1

3
event.preventDefault()

was the soultion.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.