Q:

Angular Directive not setting focus properly on recently disabled input

I have an input field that I want to disable when a user presses the 'enter' key.  It will then try and fetch a user details.  When it has fetched the details or there has been an error, I want to enable the input field again and set the focus on that field. 
I am using this directive to set the focus on the input field:
import { Directive, OnChanges, ElementRef, Input } from '@angular/core';

@Directive({
  selector: '[myFocus]'
})
export class FocusDirective implements OnChanges {

  @Input('myFocus') isFocused: boolean;
  constructor(private hostElement: ElementRef) { }

  ngOnChanges() {
    if(this.isFocused) {
        this.hostElement.nativeElement.focus();
    }
  }
}

It is implemented in the html like so:
<input type="text" class="form-control" [(ngModel)]="text"
    [myFocus]="isFocused" [disabled]="disableInput" 
    (keydown)="podcastsKeyDown($event)">

The podcastKeyDown() function looks like this:
podcastsKeyDown(event) {
    if(event.keyCode == 13) {
        this.disableInput = true;
        this.getUser(this.text).subscribe(account => {
            this.disableInput = false;
            this.isFocused = true;
        });
    }
}

When the user account has successfully returned i set the input field to be enabled, which works correctly.  However the focus is not returned to this input.  I have tried placing a timeout around re-setting the focus just in case there is some timing issue, however this did not work either.  The code looked like this:
setTimeout(() => {
    this.isPodcastNamesFocused = true;
}, 100);

Any ideas what is happening here and how to fix it? 
Thanks in Advance. 
EDIT 1: To be precise - it actually works the first time when using the timeout, but for subsequent user entries it does not...

A:

It seems this was fixed by using the setTimeout() function AND remembering to set the focus to false while the user was being fetched.  This must have been causing the focus directive to get confused. 
podcastsKeyDown(event) {
    if(event.keyCode == 13) {

        //This is the important line that was missing
        this.isFocused = false;

        this.disableInput = true;
        this.getUser(this.text).subscribe(account => {
            this.disableInput = false;
            setTimeout(() => {
                this.isFocused = true;
            });
        });
    }
}

