[Vuejs]-Shortkey doesn't work when v-textarea is focused

0👍

One way to do this is to add an event listener in the js part of the compoenent.

This will catch all keys pressed on the keyboard you can check what key is pressed with the parameter that comes with the event.

Caution this will listen to all key presses not only when focused on button/textarea.

0👍

You can use the keyup event handler to do this. Like this:

<textarea @keyup.esc="abort" @keyup.alt.enter="confirm" />

You can see more examples here.
And you can also create custom key modifiers, see here

Leave a comment