title: Angular 5 simulate keypress on input controls
body: <p>I'm trying to simulate tab key press when enter is pressed on input control.For that I use a directive:</p>
  
  <pre><code> private el: ElementRef;
      @Input() onEnter: string;
      constructor(private _el: ElementRef, public renderer: Renderer) {
          this.el = this._el;
      }
      @HostListener('keydown', ['$event']) onKeyDown(e: any) {
          if ((e.which === 13 || e.keyCode === 13)) {
              e.preventDefault();
  
  
      const event = new KeyboardEvent("keypress", {
              "key": "Tab"
            });
            this.el.nativeElement.dispatchEvent(event);
  ............
  </code></pre>
  
  <p>code for enter key fires but no tab is sent</p>