I am trying to call method on pressing enter key but it\'s not working. Code is as below.
I experienced inconsistent results when using native JS with window.addEventListener. VueJS natively supports modifying behavior for keyboard events https://vuejs.org/v2/guide/events.html#Key-Modifiers
This also worked a lot better in my case due to needing separate behavior for the tab key.
Your input can look like this with custom modifiers on each key up|down
Then inside NextItem you can reference the event, and get each key.. or write a separate function for each key modifier.