apache / cordova-ios

Apache Cordova iOS
https://cordova.apache.org/
Apache License 2.0
2.16k stars 989 forks source link

Date Picker Dismissal Leaves Viewport Shifted in iOS 14 / XCode 12 #1052

Closed JeffBerman closed 3 years ago

JeffBerman commented 3 years ago

Bug Report

Problem

If the keyboard is already visible when the iOS date picker is activated, the viewport is left in a shifted-up position.

What is expected to happen?

The content would appear in the same position as before the date picker was invoked.

What does actually happen?

When a date picker is invoked on a field that is physically low on the screen, the content is shifted up in the background when the date picker blurs out the background. It is left in this shifted state when the date picker is dismissed.

Information

I am guessing that Apple's fix to #417 doesn't take into account the scenario where the keyboard is already visible when a date field is tapped. If the date field exists near the top of the screen then the problem doesn't manifest, and if the keyboard is first dismissed before a date field is tapped then it also doesn't manifest.

Command or Code

Place a text input field near the top of the screen, and a date input field near the bottom of the screen. Tap on the text field to bring up the keyboard, then tap the date field to bring up the iOS date picker. You will see the screen scroll up at this time, where it will stick in that position after the date picker is dismissed.

Environment, Platform, Device

Xcode 12.3 iPhone 6s at iOS 14.3 iPhone 12 (simulated) and iPhone 8 (simulated) at iOS 14.3

Version information

Cordova CLI 10.0.0, Cordova-iOS 6.1.1

Checklist

Screenshots

Before tapping anything:

image

After bringing up keyboard:

image

After bringing up date picker:

image

After dismissing date picker:

image

Thank you!

dpogue commented 3 years ago

Please report this to Apple in their Feedback Assistant, and also on the WebKit bugzilla, with a test case HTML file.

There's likely nothing Cordova can do about this.

JeffBerman commented 3 years ago

Will do. Thanks!

timbru31 commented 3 years ago

Closing as this seems a WebKit bug. Feel free to crossref your WebKit bug report link and the Radar copy on https://openradar.appspot.com (if you made a copy).