question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

iOS 13 - Focus on next input element makes view moving up and down

See original GitHub issue

Bug 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:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
sandsumacommented, May 4, 2020

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.

1reaction
brodybitscommented, Feb 18, 2020

I just added the help wanted label, my apologies for lack of response so far.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Input focus issue inside iframe
Hi! I currently developing a mobile website and found that Safari on iOS has some problems setting the focus on inputs when they...
Read more >
Position:fixed in iOS5 Moves when input is focused
First set up a bind to detect when the input is onFocus, scroll to the top of the page and change the element...
Read more >
Keeping Form Elements Visible in Hybrid iOS Apps
All of the content comes along for the ride, intelligently sliding up so you can see each input's value as you type.
Read more >
Keyboard Avoidance for SwiftUI Views
We'll implement a SwiftUI ViewModifier that moves the view up and down when the iOS system keyboard covers a text field.
Read more >
iOS 15: How to Adjust Home Screen and Lock ...
1. Launch the Settings app on your iPhone, then tap Focus. 2. Select a Focus mode. 3. Under "Options," tap either Lock Screen...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found