chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
555 stars 134 forks source link

Submit on keydown.enter #107

Open Canser opened 4 years ago

Canser commented 4 years ago

Is it possible to change the behaviour of the input area;

On enter submit, on shift+enter insert a new line.

I have tried using @keydown.native="handleSubmit" but it's acting strange. It's submitting before the given model changed.

Any idea?

Note: Enter is working with e.preventDefault() but the problem is still remains; bind v-model is not changing immediately on keypress. I have even tried with nextTick but does not help. I do not want to wait with timeout or something.