iOS 13 - Focus on next input element makes view moving up and down
See original GitHub issueBug Report
Focus input while page is already focused on another cause whole view moving up and down on iOS 13.
Problem
After few tests, I’m facing the issue with focusing programatically inputs in Cordova iOS application. When application is focused on input, it shows keyboard and when is called focus of next input like nextInputElement.focus() it moves to next input but whole view moves down and up. I think that problem is with Keyboard, which makes view resizing and when I call focus of next input it makes on background hiding Keyboard and after that showing again. This is not happening on iOS 12, but only on iOS 13.
I recorded short video which shows what I’m talking about: https://youtu.be/JPWXwymjx_4
What is expected to happen?
When focus on next element, Keyboard could be freezed (still opened) and whole view shouldn’t move up and down
What does actually happen?
When focus on next element, whole view moves down and up.
Information
Create a new cordova project. Add the iOS platform. Add 2 inputs to one row. When you are focused on first, call .focus() on second (from source code) You will see that screen moves up and down
Command or Code
html:
<input id="first"/> <input id="second"/>
when you are focused on “first” element, call .focus() on “second” like:
javascript:
document.getElementById('#second').focus();
Environment, Platform, Device
Problem occurs on iOS only (iOS > 13). Tested with different phones on different versions. Not working on these devices: iPhone 11 Pro iOS 13.3 iPhone 8 Plus iOS 13.3 iPhone 8 iOS 13.3
Correctly works on these devices: iPhone 6 iOS 12.4.4
Version information
Cordova CLI: 8.1.1 (cordova-lib@8.1.1) Cordova Platform iOS: 4.5.5 Xcode: Version 11.3.1 (11C504) Operating System: macOS Catalina version 10.15.2 (19C57) Other frameworks: Angular 7
Checklist
- I searched for existing GitHub issues
- I updated all Cordova tooling to most recent version
- I included all the necessary information above
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top GitHub Comments
As temporray solution, Can you try adding plugin “cordova-plugin-ionic-keyboard” , and retest your app for the keyboard issue.
It helped me when I added the ionic keyboard plugin and tested agian.
I just added the help wanted label, my apologies for lack of response so far.