# iOS keyboard showing automatically (input in footer)

**URL:** <https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276>\
**Category:** ionic-v1\
**Created:** [April 4, 2015, 11:50am UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276 "2015-04-04T11:50:04Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![praxis](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@praxis](https://forum.ionicframework.com/u/praxis)\
**Post date:** [April 4, 2015, 11:50am UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/1 "2015-04-04T11:50:05Z")

</div>

I am building a typical whats-app like chat component for my app. Currently the input field is in the `ion-footer-bar` directive. On Android, this works flawlessly. However, on iOS, this setup causes the keyboard to automatically appear when the page is loaded. Is there anyway to disable the keyboard from automatically loading, and instead only load on input text focus?

Right now, I am running `cordova.plugins.Keyboard.close();` after a 50ms delay, but it doesn’t always work and you still see the keyboard appearing, then closing.

The behavior seems random. Sometimes the keyboard automatically loads on iOS. Sometimes it doesn’t. And sometimes this blank chunk of space does instead:

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/6/3/639f6c4cbe80ba97c90af6ef8cc66d4d737ab358.png)

![image](https://global.discourse-cdn.com/ionicframework/original/3X/f/f/ff3001a9a17dcba57b5e1934426bc4268fa9e9fc.png)

---

<div class="post-metadata">

**Author:** ![praxis](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@praxis](https://forum.ionicframework.com/u/praxis)\
**Post date:** [April 5, 2015, 6:35pm UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/2 "2015-04-05T18:35:06Z")

</div>

I realized the blank space was because the keyboard was loaded, and I called cordova.plugins.Keyboard.close(), before the view had a chance to respond properly.

Still underlying problem, that if I have an `<input>` or `<textarea>` in the footer, on iOS, the keyboard is automatically triggered on view load.

---

<div class="post-metadata">

**Author:** ![djett](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/djett/32/10369_2.png) [@djett](https://forum.ionicframework.com/u/djett)\
**Post date:** [April 5, 2015, 7:29pm UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/3 "2015-04-05T19:29:12Z")

</div>

do you have autofocus on the input or textarea? the focus event is what causes the keyboard to show

---

<div class="post-metadata">

**Author:** ![praxis](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@praxis](https://forum.ionicframework.com/u/praxis)\
**Post date:** [April 6, 2015, 8:24pm UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/4 "2015-04-06T20:24:20Z")

</div>

@djett, Nope no autofocus, here is the code.

```
<textarea class="chat_text" ng-model="input_chat" value="" placeholder="Send a message..." required minlength="1" maxlength="1500"></textarea>

```

When the same code is in the `<ion-content>`, there’s no problem (keyboard doesn’t show up). Only when it’s in the footer.

---

<div class="post-metadata">

**Author:** ![praxis](https://avatars.discourse-cdn.com/v4/letter/p/a9a28c/32.png) [@praxis](https://forum.ionicframework.com/u/praxis)\
**Post date:** [April 13, 2015, 3:41pm UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/5 "2015-04-13T15:41:33Z")

</div>

@mhartington I think I found the issue. If the `<textarea>` has a label with the class `item-input-wrapper`, and this is all in the footer, then the keyboard is automatically shown on view load. Specifically, the issue is the following CSS in that classs:

```
 -webkit-box-flex: 1;
  -webkit-flex: 1 0;
  -moz-box-flex: 1;
  -moz-flex: 1 0;
  -ms-flex: 1 0;
  flex: 1 0;

```

If that CSS is removed, then the problem seems to go away. This is the CSS that fills the input element to fill the entire width.

Here is the original HTML I was referring too:

```
<label class="item-input-wrapper">
  <textarea class="chat_text" ng-model="input_chat" value="" placeholder="Send a message..." ></textarea>
</label>

```

Any thoughts on why? I tried to expand the textarea using width:100% instead of the flexbox code, but that also leads to the same issue.

---

<div class="post-metadata">

**Author:** ![Deekshith](https://avatars.discourse-cdn.com/v4/letter/d/e274bd/32.png) [@Deekshith](https://forum.ionicframework.com/u/Deekshith)\
**Post date:** [April 17, 2015, 6:14am UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/6 "2015-04-17T06:14:07Z")

</div>

Even I’m facing the same problem.

---

<div class="post-metadata">

**Author:** ![revant1989](https://avatars.discourse-cdn.com/v4/letter/r/aca169/32.png) [@revant1989](https://forum.ionicframework.com/u/revant1989)\
**Post date:** [February 18, 2016, 3:50pm UTC](https://forum.ionicframework.com/t/ios-keyboard-showing-automatically-input-in-footer/20276/7 "2016-02-18T15:50:25Z")

</div>

I am also facing the same problem and it’s really annoying, can anyone please help @praxis
