Repository navigation
Description
Ionic version: (check one with "x")
[ ] 1.x
[x ] 2.x
I'm submitting a ... (check one with "x")
[ x] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/
Current behavior:
The onscreen keyboard covers the input element that has focus when used within the grid component.

Expected behavior:
Given an ion-grid component and a series of ion-row and ion-col components. When an ion-input component resides within an ion-col component, the on-screen keyboard should not cover the input element when it has focus.
The below demo does not use the grid/row/col components.

Steps to reproduce:
Use the following code code below to reproduce.
Related code:
<ion-header>
<ion-navbar color="navbarColor">
<ion-title><img class="title-image" src="assets/images/mb-logo-w.png"/></ion-title>
<ion-buttons end>
<a class="hidden-sm" ion-button color="light" clear href="index.html">
Start Over
</a>
<a class="hidden-lg" ion-button icon-only color="light" clear href="index.html">
<ion-icon name="power"></ion-icon>
</a>
</ion-buttons>
</ion-navbar>
</ion-header>
<ion-content>
<ion-grid>
<ion-row responsive-sm>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
</ion-col>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row responsive-sm>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-col>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row responsive-sm>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-col>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row responsive-sm>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
</ion-col>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text"></ion-input>
</ion-item>
</ion-col>
</ion-row>
<ion-row responsive-sm>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
</ion-col>
<ion-col width-50>
<ion-item>
<ion-label color="primary" stacked>First Name</ion-label>
<ion-input type="text" ></ion-input>
</ion-item>
</ion-col>
</ion-row>
</ion-grid>
</ion-content>
Other information:
IOS 10.x. I'm not experiencing the issue in the ionic 2.0.0 environment. Only since i've moved to ionic 2.1.0. I've tried to determine what differences may be present in the generated html, but I do not see any. Ionic-Keyboard plugin is installed with default configuration.
FYI: The issue doesn't occur after rolling back to "ionic-angular": "2.0.0" and "@ionic/app-scripts": "1.0.0"
Ionic info: (run ionic info from a terminal/cmd prompt and paste output below):
Cordova CLI: 6.5.0
Ionic Framework Version: 2.1.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.1.3
ios-deploy version: 1.9.0
ios-sim version: 5.0.11
OS: macOS Sierra
Node Version: v6.9.5
Xcode version: Xcode 8.2.1 Build version 8C1002
Activity
AmitMY commentedon Mar 3, 2017
I'm having the same problem on Android. Post on forum: https://forum.ionicframework.com/t/android-keyboard-is-over-the-input-doesnt-scroll-to-input/81450
(There is no new info there, just to show the problem occurs and to supply another buggy case)
mikelunn commentedon Mar 3, 2017
@AmitMY I also posted a question to the forum, as well as the slack channel. I was able to get the markup to function as expected by rolling back dependencies to "ionic-angular": "2.0.0" and "@ionic/app-scripts": "1.0.0"
brunomrpx commentedon Mar 7, 2017
Hi guys. I solved the problem adding the style
position: initialtoion-colelements. It seems thation-colhasposition: relativeand on input focus, the scroll is based on theoffsetTopthat is relative to the top of theoffsetParentnode -ion-colin this case. I think that removingthis linealso solves the problem, but I don't know if it doesn't break something.AmitMY commentedon Mar 7, 2017
@brunomrpx Thanks! Solved for me also.
mikelunn commentedon Mar 7, 2017
@brunomrpx Thanks. Setting position to initial for ion-col elements fixed the scroll issue for me as well. I'm not sure what course of action should be taken at this point. Since this was working in the 2.0.0 release, i'll leave the issue open. Thanks for your help.
dylanvdmerwe commentedon Apr 28, 2017
Note that this is still an issue with release 3.1.0.
manucorporat commentedon Apr 28, 2017
Keyboard is a big priority for us, but understand this is complicated. Fortunately I think all issues will be fixed here: https://github.com/driftyco/ionic/pull/11401/files
plus some native assistance in the latest WK plugin
lfitzgerald commentedon Apr 28, 2017
@manucorporat Do you know when 11401 will be in a release?
MikeM9999 commentedon May 8, 2017
Setting position to initial for ion-col elements worked also for me, few weeks ago.. but now it doesn't anymore (it's been some time since I last tested this). Anyone else has the same?
mikelunn commentedon May 8, 2017
@MikeMijnheer What changed? Did you upgrade your ionic version?
MikeM9999 commentedon May 8, 2017
Tbh, I cannot think of anything that changed, I didnt upgrade anything. I still have version 2.2.0.
EDIT: only thing I can think of is that I now runned the application from the .apk (after build), and previously from IonicView app. Both for Android.
EDIT: Also on IonicView it doesn't work anymore..
lpsantana commentedon May 10, 2017
Any solution on this?
viveksinha9 commentedon Jun 6, 2017
Any update on this? Having same problem.
Nightmarepg commentedon Jun 6, 2017
Im also facing this issue with Android.
59 remaining items
mhartington commentedon Apr 10, 2018
@felipegouveiae We have not turned our back on you.
We've been working on the 4.0 version of Ionic which contains a lot of bug fixes and improvements to the overall framework. This issue is closed as it's been fixed in the next major release.
brandyscarney commentedon Apr 10, 2018
I just want to chime in here. We realize it looks like we haven't been fixing issues or possibly doing much of anything because of the lack of responses on issues. The framework team is a small team - there are currently 9 of us on the framework (which includes the CLI, documentation, Stencil & more). We have a meeting every Monday morning to discuss our week, and we update our public Ionic Framework Meeting notes so others can see what we're focused on. While we could spend more time responding to issues, this would mean we are spending less time making code fixes. In order to fix a lot of the underlying issues, we made the decision to put all of our focus into the next version.
Why did we decide to go all in on the next major version? We have spent a lot of our time keeping the framework up-to-date with each release of Angular, trying to decrease startup times, and working on build scripts. The more time we spent on all of this, the less time we had to spend on improving and adding components. In order to solve this, we decided to test out migrating our internal components to use web components. We ended up building a web component compiler called Stencil to make it easier for us to create standards-based web components. What we found is that web components introduce a lot of benefits for both us as open source maintainers and you as an Ionic developer. With the switch to use web components internally startup times have decreased, less code is being shipped, many issues are being fixed indirectly, we are moving towards web standards, we're seeing performance gains that are aligned with Google's requirements for PWAs, we have decoupled ourselves from Angular releases (which means you don't have to wait on us to update!), we've switched to using Angular's tooling and we have gained the ability to support multiple frameworks.
I want to clarify that adding support for multiple frameworks does not mean we don't still love or support Angular. We are first and foremost supporting Angular, so much so that we have added support for their router and CLI. We're working hard to make the migration as smooth as possible. We recently released a
4.0.0-alpha.0of@ionic/angularand have so far received a lot of constructive & positive feedback. Hopefully we will have a beta out soon, and with it a blog post with steps to upgrade. Thank you for your understanding.renanrlp commentedon Apr 30, 2018
Thanks to @Alex0x47! Great solution! In iOS it worked beautifully, but, for me, in Android, the problem persists...
Would anyone have an idea of what might be happening?
Stephane84 commentedon Jun 6, 2018
I also had issues with the keyboard (cordova-plugin-ionic-keyboard) in ionic3.
Not in grid, but simply in a form with ion-list and ion-item of input
The keyboard was scrolling over the clicked input.
I solved it by :
putting in config.xml :
<preference name="KeyboardResizeMode" value="ionic" />putting in app.module.ts :
putting in the constructor of app.components.ts :
Then, when we click an input, we catch the event fired when the keyboard is shown, and, use js function scrollIntoView on the focused element, to make it visible in the DOM by scrolling the content.
scrollIntoView can be align to top of scroll-content or at the bottom with the keyboard.
You can also try to add margin top or bottom at the input by scrolling many px :
Nytsee commentedon Jun 29, 2018
Hey everyone, i've been struggling with this issue for a long time and this line solved it 👍
page-chat{
.scroll-content{
margin-top:50px !important; // the value should be the exacte ion-header height !
}
}
hiepxanh commentedon Jun 30, 2018
Ithank you @Nytsee y
maikonigor commentedon Aug 15, 2018
the solution proposed by @brunomrpx worked fine for me!
Obrigado cara! Se eu tivesse perto de ti, te pagava uma cerveja!
atheerahassan commentedon Aug 21, 2018
none of the answers worked for me when I run ionic serve -l. everything just seems to be perfectly fine when I generate it in apk..
rdss-jpupeter commentedon Aug 28, 2018
@Alex0x47 thanks for your approach! Additionally to your solution I have to add the following line to the app.component.ts
this.keyboard.didShow.subscribe(() =>{ document.activeElement.scrollIntoView(false) })keyboard is an instance of Keyboard from '@Ionic-Angular'
MrDrProfX commentedon Sep 19, 2018
Here's a directive you can slap on to any div container which will auto adjust the marginBottom to account for the keyboard size
<div move-up-with-keyboard>...</div>:(don't use it on ion-content, that wont work, use it on a div or other normal containers)
ionitron-bot commentedon Nov 7, 2018
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.