Is it possible using vue.js to simulate another button pressed when a button is pressed?
For example, if I press the ↓ (Arrow down) button, I would l
I think you're asking how to simulate a TAB keypress when the user presses DOWN with the goal of moving the focus to the next focusable input.
Instead of rewriting the key
-event, you could call HTMLElement#focus() on the next sibling:
// SCRIPT
methods: {
nextInput(e) {
const next = e.currentTarget.nextElementSibling;
if (next) {
next.focus();
}
},
prevInput(e) {
const prev = e.currentTarget.previousElementSibling;
if (prev) {
prev.focus();
}
},
}