matiastucci/vue-input-tag

Unable to prevent enter key submit form

Closed this issue · 0 comments

Version of Vue I'm using?: 2.3.3_

Version of vue-input-tag I'm using?: 0.0.15_

When I press enter key in the input field inside input-tag component, it not only create a new tag, but also trigger the click event click() on the button. Is there anyway that I can prevent the default form submission?

I already tried v-on:submit.prevent on the form, but no luck.

Here's the code:

<form v-on:submit.prevent="prevent" >
  <input-tag type="primary" :tags="tags" placeholder="Emails" validate="email"></input-tag>
  <button type="button" :click="click()">Invite</button>
</form>