From f887dc8a965982ab877dc96f2f4af65788286337 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Farkas=20J=C3=B3zsef?= Date: Sat, 3 Dec 2016 20:22:32 +0100 Subject: [PATCH] Macro name select Closes #208 --- src/components/macro/header/macro-header.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/macro/header/macro-header.component.ts b/src/components/macro/header/macro-header.component.ts index cc19728f..ddec48e3 100644 --- a/src/components/macro/header/macro-header.component.ts +++ b/src/components/macro/header/macro-header.component.ts @@ -1,5 +1,5 @@ import { - ChangeDetectionStrategy, Component, ElementRef, Input, OnChanges, Renderer, + AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, Input, Renderer, ViewChild } from '@angular/core'; @@ -16,16 +16,16 @@ import { AppState } from '../../../store/index'; styles: [require('./macro-header.component.scss')], changeDetection: ChangeDetectionStrategy.OnPush }) -export class MacroHeaderComponent implements OnChanges { +export class MacroHeaderComponent implements AfterViewInit { @Input() macro: Macro; @Input() isNew: boolean; @ViewChild('macroName') macroName: ElementRef; constructor(private store: Store, private renderer: Renderer) { } - ngOnChanges() { + ngAfterViewInit() { if (this.isNew) { - this.renderer.invokeElementMethod(this.macroName.nativeElement, 'focus', []); + this.renderer.invokeElementMethod(this.macroName.nativeElement, 'select', []); } }