Level 102
Does what your are doing there not work?
Personally I prefer keycodes
function(event) {
if(event.keyCode === 13)
{
console.log("enter key was pressed!");
}
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hi all, I wonder if there is a better way to detect the enter key in vue please:
<input id="field1" type="text" v-on:keyup="keymonitor">
keymonitor: function(event) {
console.log(event.key);
if(event.key == "Enter")
{
console.log("enter key was pressed!");
}
I tried keyup.enter but this starts my search when the key is released which is incorrect. I only need my search to start if the enter key is tapped, not on every key up.
Any idea please?
Thanks.
Please or to participate in this conversation.