i have problem with input and lists, I would like to go through from input to list element below and add class 'active' to current li element
<div class="control">
<label class="label">Input Test</label>
<input type="text" class="input" @keydown="keyHandler">
<ul>
<li v-for="suggestion in suggestions" v-bind:class="{active}">{{suggestion.message}}</li>
</ul>
</div>
methods : {
keyHandler(e){
if(e.keyCode === 38){
e.preventDefault();
console.log('arrow up')
this.currentKey = e.key
}
else if(e.keyCode === 40){
e.preventDefault();
console.log('arrow down')
this.currentKey = e.key
}
}
}
here is fiddle: https://jsfiddle.net/o8fwf0gh/13/
I would be grateful for help