# Unable to Autofocus Input

**URL:** <https://forum.ionicframework.com/t/unable-to-autofocus-input/110098>\
**Category:** ionic-v3\
**Created:** [October 26, 2017, 5:31pm UTC](https://forum.ionicframework.com/t/unable-to-autofocus-input/110098 "2017-10-26T17:31:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![texasman03](https://avatars.discourse-cdn.com/v4/letter/t/eb9ed0/32.png) [@texasman03](https://forum.ionicframework.com/u/texasman03)\
**Post date:** [October 26, 2017, 5:31pm UTC](https://forum.ionicframework.com/t/unable-to-autofocus-input/110098/1 "2017-10-26T17:31:43Z")

</div>

I have a regular input ( not an ionic input ) inside of a modal. I want to autofocus it after the modal slides up, but the code I thought would work does not, the input does not focus and the keyboard does not show up.

HTML

```auto
<input #test id="test"
              (touchstart)="focusInput()"
              (keypress)="enterPress($event)"
              maxlength="20"
              class="pure-input"
              type="text"
              placeholder="Test...">

```

Component:

I have tried this in a setTimeout or just by itself

```auto
ngOnInit() {
    let ele = document.getElementById('test');
    ele.focus();
  }

```

Also tried calling this

```auto
public focusInput() {
    this.testInput.nativeElement.focus();
  }

```

Neither works on the input
