Issue
Issue
When I click the text input from the modal, a keyboard overlaps the text input. This issue has found during testing on iPhone SE (iOS 11) device.
I've looked up a several threads and tried to figure out on my own, but I've realized that my current problem has been a chronic issue for Ionic developers until now.
These are the related links to my issue. I've tried given solutions from links below, but none of them worked 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 Info
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 behavior
Ion input should stay in a position right above the keyboard while a user types some messages.
Actual behavior
app.component.ts
I've included keyboard.disableScroll(true);
inside platform.ready()
to prevent navbar crashing issue. Without this line of code, the keyboard works fine with the input text. But it pushes the whole content to the top including navbar, thus for the first few messages appear to be hidden.
Any ideas?
UPDATED
I'm not sure the way I've solved the issue is the best solution, but for now, I replaced the content and footer's margin-bottom with a sum of an initial height of text area and the keyboard height.
If you have a better solution, feel free to leave it as an answer.
Here's the final result.
Solution
I was having similar problems in a similar project setup where the keyboard in iOS overlapped the footer bar in ionic. I was able to solve it by removing the [email protected]
and adding [email protected]
https://github.com/ionic-team/cordova-plugin-ionic-keyboard
Apparently I didn't notice that ionic-plugin-keyboard
was deprecated as I was upgrading my project from Ionic 1 to 2, I'm guessing you may have been in a similar position.
Answered By - coderroggie
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.