Setting Focus to an Input in Ionic

this way not works for me at all, I use code like this:

let element = this.elementRef.nativeElement.querySelector('input');
this.renderer.invokeElementMethod(element, 'focus', []);

where

private renderer: Renderer, private elementRef: ElementRef

in my constructor. This code allow to set focus on input element on a page.

6 Likes