ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: iOS white screen after keyboard show (in v1.2.1 and v1.2.0 only)

Open DanailMinchev opened this issue 10 years ago • 78 comments

Type: bug

Platform: ios 8 webview

Hi,

The bug is reproducible with latest ionic releases 1.2.1 and 1.2.0, but not with 1.1.1. In 1.1.1 it works fine.

On iOS, when I tap on some html input:

  • The keyboard is shown - OK: photo 22-12-2015 14 23 14
  • I can enter some text and select another inputs (but without closing the keyboard dialog) - OK photo 22-12-2015 14 24 06
  • Once the keyboard is closed (either with Done button or just by tapping to non-input space) - the inputs with their labels become white, but I can still type into inputs with white font - so it looks like white screen which overlays the content. photo 22-12-2015 14 24 51 photo 22-12-2015 14 24 55

Code example:

<ion-view view-title="Log In" can-swipe-back="false" hide-back-button="true">
  <ion-content padding="true" has-bouncing="false">
    <form ng-submit="vm.loginFormAction(vm.loginFormData)" novalidate>
      <div class="list">
        <label class="item item-input item-floating-label">
          <span class="input-label">Username</span>
          <input ng-model="vm.loginFormData.username" type="text" placeholder="Email or Phone number">
        </label>
        <label class="item item-input item-floating-label">
          <span class="input-label">Password</span>
          <input ng-model="vm.loginFormData.password" type="password" placeholder="Password">
        </label>
      </div>
      <div class="padding">
        <button class="button button-block button-positive" type="submit">Log In</button>
      </div>
    </form>
  </ion-content>
</ion-view>

also I've tried with the new ion-input directive:

<ion-view view-title="Log In" can-swipe-back="false" hide-back-button="true">
  <ion-content padding="true" has-bouncing="false">
    <form ng-submit="vm.loginFormAction(vm.loginFormData)" novalidate>
      <div class="list">
        <ion-input class="item item-input item-floating-label">
          <ion-label>Username</ion-label>
          <input ng-model="vm.loginFormData.username" type="text" placeholder="Email or Phone number">
        </ion-input>
        <ion-input class="item item-input item-floating-label">
          <ion-label>Password</ion-label>
          <input ng-model="vm.loginFormData.password" type="password" placeholder="Password">
        </ion-input>
      </div>
      <div class="padding">
        <button class="button button-block button-positive" type="submit">Log In</button>
      </div>
    </form>
  </ion-content>
</ion-view>

ionic info

Your system information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.2.1-nightly-1867
Ionic CLI Version: 1.7.12
Ionic App Lib Version: 0.6.5
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04 LTS 
Node Version: v5.0.0

ionic platform ls

Updated the hooks directory to have execute permissions
Installed platforms: android 5.0.0, ios 3.9.2
Available platforms: amazon-fireos, blackberry10, browser, firefoxos, ubuntu, webos

config.xml

  <preference name="HideKeyboardFormAccessoryBar" value="false"/>
  <preference name="KeyboardDisplayRequiresUserAction" value="false"/>
  <preference name="SuppressesLongPressGesture" value="true"/>

  <plugin name="ionic-plugin-keyboard" spec="1.0.8"/>

bower.json

"ionic": "driftyco/ionic-bower#1.2.1"
"ionic-platform-web-client": "0.2.1"

DanailMinchev avatar Dec 22 '15 14:12 DanailMinchev

Hmm, not able to reproduce on iOS 9. Can you try this app and let me know what you see in the first dashboard tab with the keyboard?

http://ionic-io-assets.s3.amazonaws.com/pp2.tar.gz

mlynch avatar Dec 22 '15 16:12 mlynch

The result is the same as with my original app ..

  • The initial screen (no tapping / action) - OK photo 22-12-2015 17 12 54
  • On Email or Phone Number input tapping - OK photo 22-12-2015 17 13 16
  • On Email or Phone Number texting "Test" - OK photo 22-12-2015 17 13 29
  • After tapping on the second input Password - white screen after quick blinking photo 22-12-2015 17 13 39 photo 22-12-2015 17 13 50

I am using:

iPhone 4s
iOS 9.2 (13C75)
Xcode 7.1
xcodebuild -showsdks -> iOS 9.1

DanailMinchev avatar Dec 22 '15 17:12 DanailMinchev

+1. It woks fine if I remove the ion-content tag after ion-view

emeryao avatar Dec 23 '15 06:12 emeryao

+1 in iOS 9.2 / iPhone 6s Temporary solved by replacing <ion-content> with <ion-scroll>

<ion-scroll direction="y" style="right: 0;bottom: 0;left: 0;position: absolute;" class="has-header has-subheader">

Lsozke avatar Dec 23 '15 15:12 Lsozke

I had the same. Reproducible in IOS Simulator iPhone 5s with IOS 9.2, but not with iPhone 6. Temporary workaround is to set overflow-scroll to false on ion-content.

RBLU avatar Dec 23 '15 20:12 RBLU

+1 seeing this with wkwebview

andreialecu avatar Dec 26 '15 01:12 andreialecu

Seems to be the same issue as https://github.com/driftyco/ionic/issues/4645 where I added quite an extensive comment: https://github.com/driftyco/ionic/issues/4645#issuecomment-165884959

Our temporary workaround is to set overflow-y to hidden whenever a keyboard transition starts and to set it back to scroll whenever a keyboard transition has ended. Having this in place, the blank screen issue seems not to occur anymore. However, this should be temporary only.

SebastianSchirmer avatar Dec 26 '15 10:12 SebastianSchirmer

Yes, temporary downgrade to 1.1.1 to avoid this bug

albertytau avatar Dec 29 '15 18:12 albertytau

Do you guys have the ionic-plugin-keyboard plugin installed? I was only able to reproduce this without the plugin installed, which is expected. The keyboard plugin is required for proper keyboard behavior

mlynch avatar Dec 30 '15 21:12 mlynch

Okay, it seems to fail when using the accessory bar with the keyboard plugin. One solution is to not use the accessory bar (which is the default and more native like anyways). Looking into fixing this.

mlynch avatar Dec 30 '15 21:12 mlynch

Err, not quite resolved just yet, need to reset something

mlynch avatar Dec 31 '15 03:12 mlynch

I haven't used the keyboard plugin but it dosen't work either

emeryao avatar Dec 31 '15 08:12 emeryao

I cannot use ionic-plugin-keyboard because it is broken with WKWebView. Meaning the accessory bar cannot be hidden and it doesn't disable scroll either.

cordova-plugin-keyboard works as per this commit.

andreialecu avatar Dec 31 '15 11:12 andreialecu

Okay, just pushed a fix for this to master. Can you try and let me know?

I suppose we'll need to update our plugin for wkwebview. The major important point is that disable scroll has to be set to true on the web view if you want normal behavior. If you're not using WKWebView, you will want to use ionic-plugin-keyboard for your app.

mlynch avatar Dec 31 '15 18:12 mlynch

Thanks @mlynch for the fix. I'll try it in a couple of days, off for New Years right now. We are using the keyboard plugin but not WKWebView.

SebastianSchirmer avatar Dec 31 '15 18:12 SebastianSchirmer

@mlynch

I can confirm that it's working with my configuration:

  • iOS 3.9.2
  • ionic-plugin-keyboard 1.0.8

Thank you!

DanailMinchev avatar Jan 02 '16 15:01 DanailMinchev

@mlynch Confirm that no blank screens occur anymore in our setup using 1.2.2.

SebastianSchirmer avatar Jan 02 '16 15:01 SebastianSchirmer

@leschirmeur thanks. Thinking of going back to JS scrolling for iOS given a number of issues we're discovering now. Want to apologize to everyone for the QA issues in this recent release.

mlynch avatar Jan 02 '16 16:01 mlynch

the problem exists with (select), I have the same problem when taping on the screen to hide the select menu, the screen became white this invisible components simulator screen shot 1 feb 2016 11 44 55 simulator screen shot 1 feb 2016 11 46 06

mazagatshy avatar Feb 01 '16 08:02 mazagatshy

using ion-scroll instead of ion-content solve the problem

mazagatshy avatar Feb 01 '16 08:02 mazagatshy