I want to use tab key to perform some logic but not actually change the focus. According to this answer's comments I can use false in my markup or preventDefault() in the method. I have both like this.
onKey(event: KeyboardEvent) {
event.preventDefault();
if(event.key = "Tab") { this.update.emit(this.config); }
}
<input #input
title="{{config|json}}"
value="{{config.value}}"
(keyup)="onKey($event)"
(keydown.Tab)="onKey($event);false;">
Still, it gets an extra jump when I hit tab key. When I tried the very same logic but based on other keys (e.g. "a" or "enter"), the behavior is as expected, so I conclude that the logic is correct. For some reason, by tab is unruly and propagates the event as if I want to tab twice.
Am I handling tab key up incorrectly? Not sure what to google for other than what I already have.