1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-01-29 22:31:29 +01:00

element array instead of node list

This commit is contained in:
Kyle Spearrin 2018-06-05 13:28:09 -04:00
parent 22c12cf5c4
commit 66b3dbae17

View File

@ -10,14 +10,14 @@ import {
}) })
export class BoxRowDirective implements OnInit { export class BoxRowDirective implements OnInit {
el: HTMLElement = null; el: HTMLElement = null;
formEls: NodeListOf<Element>; formEls: Element[];
constructor(private elRef: ElementRef) { constructor(private elRef: ElementRef) {
this.el = elRef.nativeElement; this.el = elRef.nativeElement;
} }
ngOnInit(): void { ngOnInit(): void {
this.formEls = this.el.querySelectorAll('input:not([type="hidden"]), select, textarea'); this.formEls = Array.from(this.el.querySelectorAll('input:not([type="hidden"]), select, textarea'));
this.formEls.forEach((formEl) => { this.formEls.forEach((formEl) => {
formEl.addEventListener('focus', (event: Event) => { formEl.addEventListener('focus', (event: Event) => {
this.el.classList.add('active'); this.el.classList.add('active');