Problem
Encountering an issue where the keyboard overlaps the text input in a modal when clicked. This problem was identified while testing on an iPhone SE (iOS 11) device.
After researching multiple threads, it seems that Ionic developers have been facing this persistent issue for a while now.
Here are some relevant links related to the problem: Despite trying solutions provided in the following links, none of them seem to work with my code.
- Keyboard issue
- Keyboard overlaps the text input when the input is placed inside an ion-footer
- Keyboard hides input until I start typing
- Ionic 2 On-Screen Keyboard Covers Focused Input Element Inside Grid Component
Version Information
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
@ionic/app-scripts : 3.1.4
Cordova Platforms : android 6.3.0 ios 4.5.4
Ionic Framework : ionic-angular 3.9.2
System:
ios-deploy : 1.9.2
Node : v8.9.0
npm : 5.5.1
OS : macOS High Sierra
Xcode : Xcode 9.2 Build version 9C40b
Expected Outcome
The Ion input should remain positioned just above the keyboard as the user types messages.
Current Behavior
https://i.sstatic.net/maRcu.gif
app.component.ts
To avoid navbar crashing issues, keyboard.disableScroll(true);
has been implemented within platform.ready()
. However, without this line of code, the keyboard functions properly but shifts the entire content upwards including the navbar, causing initial messages to be hidden.
Any suggestions?
UPDATE
Although unsure if my solution is optimal, currently, I've adjusted the margins of the content and footer by considering the initial height of the text area and the keyboard height combined.
If you have a better resolution, feel free to share it as an answer.
Here's the final outcome: