I have been working on a solution where pressing the enter key or losing focus on an element will hide it and display a message. However, I am facing an issue where when I press the enter key to hide the element, it also triggers the blur event. I only want one of these events to be executed at a time.
Furthermore, is there a way to avoid calling the hideField() function twice by somehow combining the blur and key.enter events into one?
<input id="name" v-on:blur="hideField('name')" v-on:keyup.enter="hideField('name')">
Check out this fiddle for reference: http://jsfiddle.net/dag5ch26/3/