add search + note

This commit is contained in:
_Bastler
2021-06-06 17:09:09 +02:00
parent a69647ffde
commit 57d2bf97fb
14 changed files with 60 additions and 22 deletions
+7 -4
View File
@@ -1,15 +1,18 @@
import { Directive, OnInit } from '@angular/core';
import { Directive, ElementRef, OnInit } from '@angular/core';
import { MatInput } from '@angular/material/input';
@Directive({
selector: '[matInputAutofocus]',
selector: '[matAutofocus]',
})
export class AutofocusDirective implements OnInit {
constructor(private matInput: MatInput) { }
constructor(private element: ElementRef) { }
ngOnInit() {
setTimeout(() => this.matInput.focus());
setTimeout(() => {
this.element.nativeElement.focus();
this.element.nativeElement.scrollIntoView();
})
}
}