Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic 3.X Weird Extra Top Padding For Ion-Content #13229

Closed
dalezak opened this issue Oct 24, 2017 · 31 comments
Closed

Ionic 3.X Weird Extra Top Padding For Ion-Content #13229

dalezak opened this issue Oct 24, 2017 · 31 comments

Comments

@dalezak
Copy link

dalezak commented Oct 24, 2017

Ionic version: (check one with "x")
(For Ionic 1.x issues, please use https://github.com/ionic-team/ionic-v1)
[ ] 2.x
[X] 3.x
[ ] 4.x

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request

Current behavior:
Since upgrading to ionic-angular 3.7.1, I've been experiencing a weird top padding issues with ion-content.

Initially the view loads fine, however after interacting with the view like rebinding data or refreshing using the ion-refresher, the top of the ion-content gets shifted down with extra top padding, which appears the same height as the status bar.

Oddly enough, text that has user-select: text enabled in the CSS to allow copy & paste, is being highlighted where the input is suppose to be rather than where it is.

Expected behavior:
The content padding should be consistent, and not changed after interacting with the view.

Steps to reproduce:

Before

content-before

After

content-after

@kensodemann
Copy link
Member

Hello! Thank you for opening an issue with us!

Please check that you are using WKWebView and not UIWebView.

If you have this plugin installed, you are using WKWebView (which is what you want)
https://github.com/ionic-team/cordova-plugin-ionic-webview

Using WKWebView has a few caveats that may need to be dealt with in your app. However it is the proper way forward for many reasons.

http://ionicframework.com/docs/wkwebview/

If you are using WKWebView and still are having the issue, would you be able to provide a sample application via GitHub that demonstrates the issue you are having?

Thanks for using Ionic!

@dalezak
Copy link
Author

dalezak commented Oct 24, 2017

Thanks @kensodemann for the reply!

I tried to upgrade to WKWebView, unfortunately it didn't seem to fix the issue. I removed /platforms and /plugins, re-added iOS platform but still not luck.

One app I'm developing, I can upgrade to WKWebView, so hopefully this can fix my issue. However another app I'm building still needs to use UIWebView because I ran into some CORS and local files issues with WKWebView.

Is there any way to fix this issue so it doesn't happen in either WKWebView or UIWebView?

Some other forum posts also recommend upgrading to WKWebView, but that doesn't seem to be a fix for those still using UIWebView?

@kensodemann
Copy link
Member

For the CORs issues, have you tried this? http://ionicframework.com/docs/wkwebview/#cors

Is there any way to fix this issue so it doesn't happen in either WKWebView or UIWebView?

According to my understanding of issue #12958 (which I think is the same as what you are seeing), no. It is due to a bug in UIWebView (which is an Apple thing that we can do nothing about, and it is the older of the web views and Apple has been suggesting ppl use WKWebView since iOS 8 or 9, so I don't really see it getting much love from Apple, honestly).

However, if updating to WKWebView did not fix the issue for you, there may be more going on. Can you duplicate this in a sample application? Basically, start with whatever starter is closest to your app's architecture and add the minimal stuff required to get it to happen and then upload to GitHub? Unless, of course, your app itself is already in a public repo.

One other thing to check would be that everything here is handled: https://blog.ionic.io/ios-11-checklist/

@dalezak
Copy link
Author

dalezak commented Oct 24, 2017

Thanks @kensodemann, I'll review https://blog.ionic.io/ios-11-checklist/ again to see if I missed something. It does seem like a similar issue to #12958.

Another weird thing I noticed, when the extra spacing appears, it's like the content behind has moved down but the touch area has not.

For example, to select a ion-item row, you actually need to click above the ion-list, the same above of spacing that it's been shifted down. I don't know if that helps or not.

@mhartington
Copy link
Contributor

This should be address via

This will be the nightly version

@Sampath-Lokuge
Copy link

When you'll release this version? I mean 3.7.2 or like that? @mhartington

@dalezak
Copy link
Author

dalezak commented Oct 25, 2017

Weird @mhartington, even with the nightly build it's still happening for me.

The view loads fine but any kind of rebinding to data, the extra space appears. However using the ion-refresher control, the extra space disappears again.

@dalezak
Copy link
Author

dalezak commented Oct 26, 2017

Here's the details of the package.json and config.xml in case it helps.

{
  "name": "our-app",
  "version": "0.12.0",
  "author": "Us",
  "homepage": "http://www.website.com",
  "private": true,
  "scripts": {
    "build": "ionic-app-scripts build",
    "clean": "ionic-app-scripts clean",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "npm run build",
    "ionic:serve": "npm run serve",
    "ionic:lint": "npm run lint"
  },
  "dependencies": {
    "@angular/animations": "4.4.4",
    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/compiler-cli": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/forms": "4.4.4",
    "@angular/http": "4.4.4",
    "@angular/platform-browser": "4.4.4",
    "@angular/platform-browser-dynamic": "4.4.4",
    "@ionic-native/app-availability": "^4.3.1",
    "@ionic-native/app-version": "^4.3.1",
    "@ionic-native/call-number": "^4.3.1",
    "@ionic-native/camera": "^4.3.1",
    "@ionic-native/contacts": "^4.3.1",
    "@ionic-native/core": "^4.3.1",
    "@ionic-native/deeplinks": "^4.3.1",
    "@ionic-native/device": "^4.3.1",
    "@ionic-native/diagnostic": "^4.3.1",
    "@ionic-native/file": "^4.3.1",
    "@ionic-native/geolocation": "^4.3.1",
    "@ionic-native/in-app-browser": "^4.3.1",
    "@ionic-native/is-debug": "^4.3.1",
    "@ionic-native/keyboard": "^4.3.1",
    "@ionic-native/native-storage": "^4.3.1",
    "@ionic-native/network": "^4.3.1",
    "@ionic-native/sim": "^4.3.1",
    "@ionic-native/social-sharing": "^4.3.1",
    "@ionic-native/splash-screen": "^4.3.1",
    "@ionic-native/sqlite": "^4.3.1",
    "@ionic-native/status-bar": "^4.3.1",
    "@ionic-native/themeable-browser": "^4.3.1",
    "@ionic-native/transfer": "^3.14.0",
    "@ionic/storage": "2.0.1",
    "call-number": "git+https://github.com/Rohfosho/CordovaCallNumberPlugin.git",
    "cordova-android": "^6.2.3",
    "cordova-ios": "~4.5.2",
    "cordova-custom-config": "^4.0.2",
    "cordova-plugin-app-version": "^0.1.9",
    "cordova-plugin-appavailability": "^0.4.2",
    "cordova-plugin-camera": "^2.4.1",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-contacts": "^2.3.1",
    "cordova-plugin-device": "^1.1.6",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-file-transfer": "^1.6.3",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-ionic-keyboard": "^2.0.4",
    "cordova-plugin-ionic-webview": "^1.1.16",
    "cordova-plugin-is-debug": "^1.0.0",
    "cordova-plugin-nativestorage": "^2.2.2",
    "cordova-plugin-network-information": "^1.3.3",
    "cordova-plugin-sim": "^1.3.3",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.3",
    "cordova-plugin-themeablebrowser": "^0.2.17",
    "cordova-plugin-whitelist": "^1.3.2",
    "cordova-plugin-x-socialsharing": "^5.2.1",
    "cordova-sqlite-storage": "^2.0.4",
    "cordova.plugins.diagnostic": "^3.7.1",
    "es6-promise-plugin": "^4.1.0",
    "ionic-angular": "nightly",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "moment": "^2.18.1",
    "ng-lazyload-image": "^3.3.1",
    "rxjs": "5.4.3",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "nightly",
    "typescript": "~2.3.2"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-whitelist",
    "cordova-plugin-statusbar",
    "cordova-plugin-splashscreen"
  ],
  "cordovaPlatforms": [
    "ios",
    {
      "platform": "ios",
      "version": "",
      "locator": "ios"
    }
  ],
  "description": "Rollcall App",
  "cordova": {
    "plugins": {
      "cordova-plugin-app-version": {},
      "cordova-plugin-appavailability": {},
      "cordova-plugin-camera": {
        "CAMERA_USAGE_DESCRIPTION": "This app would like to access your camera.",
        "PHOTOLIBRARY_USAGE_DESCRIPTION": "This app would like to access your photo library."
      },
      "cordova-plugin-contacts": {
        "CONTACTS_USAGE_DESCRIPTION": "This app would like to access your contacts."
      },
      "cordova-plugin-device": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "This app would like to access your location."
      },
      "cordova-plugin-is-debug": {},
      "cordova-plugin-nativestorage": {},
      "cordova-plugin-network-information": {},
      "cordova-plugin-sim": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-x-socialsharing": {},
      "cordova-sqlite-storage": {},
      "cordova.plugins.diagnostic": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-custom-config": {},
      "cordova-plugin-themeablebrowser": {},
      "cordova-plugin-ionic-webview": {},
      "call-number": {}
    },
    "platforms": [
      "ios"
    ]
  }
}
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ourapp.id" version="0.12.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>OurApp</name>
    <description>OurApp</description>
    <author email="[email protected]" href="https://www.website.com">Company</author>
    <content original-src="index.html" src="http://192.168.0.12:8100" />
    <access origin="*" />
    <allow-navigation href="http://ionic.local/*" />
    <allow-navigation href="http://localhost:3000" />
    <allow-navigation href="http://192.168.0.12:8100" />
    <allow-navigation href="http://192.168.0.13:8100" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <preference name="orientation" value="portrait" />
    <preference name="ScrollEnabled" value="false" />
    <preference name="webviewbounce" value="false" />
    <preference name="UIWebViewBounce" value="false" />
    <preference name="DisallowOverscroll" value="true" />
    <preference name="BackupWebStorage" value="none" />
    <preference name="AutoHideSplashScreen" value="false" />
    <preference name="SplashScreen" value="screen" />
    <preference name="SplashScreenDelay" value="1000" />
    <preference name="SplashShowOnlyFirstTime" value="false" />
    <preference name="FadeSplashScreenDuration" value="500" />
    <preference name="StatusBarStyle" value="lightcontent" />
    <preference name="StatusBarOverlaysWebView" value="true" />
    <preference name="StatusBarBackgroundColor" value="#F8F7F3" />
    <preference name="ShowSplashScreenSpinner" value="true" />
    <preference name="android-build-tool" value="gradle" />
    <preference name="android-targetSdkVersion" value="24" />
    <preference name="android-minSdkVersion" value="19" />
    <preference name="LoadUrlTimeoutValue" value="90000" />
    <preference name="KeyboardDisplayRequiresUserAction" value="false" />
    <preference name="AllowInlineMediaPlayback" value="true" />
    <preference name="MediaPlaybackRequiresUserAction" value="true" />
    <preference name="iosPersistentFileLocation" value="Compatibility" />
    <preference name="AndroidPersistentFileLocation" value="Compatibility" />
    <preference name="iosExtraFilesystems" value="library,library-nosync,documents,documents-nosync,cache,bundle,root" />
    <preference name="AndroidExtraFilesystems" value="files,files-external,documents,sdcard,cache,cache-external,assets,root" />
    <platform name="android">
        <allow-intent href="market:*" />
        <icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
        <icon density="mdpi" src="resources/android/icon/drawable-mdpi-icon.png" />
        <icon density="hdpi" src="resources/android/icon/drawable-hdpi-icon.png" />
        <icon density="xhdpi" src="resources/android/icon/drawable-xhdpi-icon.png" />
        <icon density="xxhdpi" src="resources/android/icon/drawable-xxhdpi-icon.png" />
        <icon density="xxxhdpi" src="resources/android/icon/drawable-xxxhdpi-icon.png" />
        <splash density="land-ldpi" src="resources/android/splash/drawable-land-ldpi-screen.png" />
        <splash density="land-mdpi" src="resources/android/splash/drawable-land-mdpi-screen.png" />
        <splash density="land-hdpi" src="resources/android/splash/drawable-land-hdpi-screen.png" />
        <splash density="land-xhdpi" src="resources/android/splash/drawable-land-xhdpi-screen.png" />
        <splash density="land-xxhdpi" src="resources/android/splash/drawable-land-xxhdpi-screen.png" />
        <splash density="land-xxxhdpi" src="resources/android/splash/drawable-land-xxxhdpi-screen.png" />
        <splash density="port-ldpi" src="resources/android/splash/drawable-port-ldpi-screen.png" />
        <splash density="port-mdpi" src="resources/android/splash/drawable-port-mdpi-screen.png" />
        <splash density="port-hdpi" src="resources/android/splash/drawable-port-hdpi-screen.png" />
        <splash density="port-xhdpi" src="resources/android/splash/drawable-port-xhdpi-screen.png" />
        <splash density="port-xxhdpi" src="resources/android/splash/drawable-port-xxhdpi-screen.png" />
        <splash density="port-xxxhdpi" src="resources/android/splash/drawable-port-xxxhdpi-screen.png" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
        <config-file parent="ITSAppUsesNonExemptEncryption" platform="ios" target="*-Info.plist">
            <false />
        </config-file>
        <icon height="57" src="resources/ios/icon/icon.png" width="57" />
        <icon height="114" src="resources/ios/icon/[email protected]" width="114" />
        <icon height="40" src="resources/ios/icon/icon-40.png" width="40" />
        <icon height="80" src="resources/ios/icon/[email protected]" width="80" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="50" src="resources/ios/icon/icon-50.png" width="50" />
        <icon height="100" src="resources/ios/icon/[email protected]" width="100" />
        <icon height="60" src="resources/ios/icon/icon-60.png" width="60" />
        <icon height="120" src="resources/ios/icon/[email protected]" width="120" />
        <icon height="180" src="resources/ios/icon/[email protected]" width="180" />
        <icon height="72" src="resources/ios/icon/icon-72.png" width="72" />
        <icon height="144" src="resources/ios/icon/[email protected]" width="144" />
        <icon height="76" src="resources/ios/icon/icon-76.png" width="76" />
        <icon height="152" src="resources/ios/icon/[email protected]" width="152" />
        <icon height="167" src="resources/ios/icon/[email protected]" width="167" />
        <icon height="29" src="resources/ios/icon/icon-small.png" width="29" />
        <icon height="58" src="resources/ios/icon/[email protected]" width="58" />
        <icon height="87" src="resources/ios/icon/[email protected]" width="87" />
        <splash height="1136" src="resources/ios/splash/Default-568h@2x~iphone.png" width="640" />
        <splash height="1334" src="resources/ios/splash/Default-667h.png" width="750" />
        <splash height="2208" src="resources/ios/splash/Default-736h.png" width="1242" />
        <splash height="1242" src="resources/ios/splash/Default-Landscape-736h.png" width="2208" />
        <splash height="1536" src="resources/ios/splash/Default-Landscape@2x~ipad.png" width="2048" />
        <splash height="2048" src="resources/ios/splash/Default-Landscape@~ipadpro.png" width="2732" />
        <splash height="768" src="resources/ios/splash/Default-Landscape~ipad.png" width="1024" />
        <splash height="2048" src="resources/ios/splash/Default-Portrait@2x~ipad.png" width="1536" />
        <splash height="2732" src="resources/ios/splash/Default-Portrait@~ipadpro.png" width="2048" />
        <splash height="1024" src="resources/ios/splash/Default-Portrait~ipad.png" width="768" />
        <splash height="960" src="resources/ios/splash/Default@2x~iphone.png" width="640" />
        <splash height="480" src="resources/ios/splash/Default~iphone.png" width="320" />
        <icon height="1024" src="resources/ios/icon/icon-1024.png" width="1024" />
        <splash height="2732" src="resources/ios/splash/Default@2x~universal~anyany.png" width="2732" />
    </platform>
    <feature name="Device">
        <param name="ios-package" value="CDVDevice" />
    </feature>
    <feature name="StatusBar">
        <param name="ios-package" onload="true" value="CDVStatusBar" />
    </feature>
    <feature name="SocialSharing">
        <param name="ios-package" value="SocialSharing" />
    </feature>
    <feature name="SocialSharing">
        <param name="android-package" value="nl.xservices.plugins.SocialSharing" />
    </feature>
    <feature name="CDVWKWebViewEngine">
        <param name="ios-package" value="CDVWKWebViewEngine" />
    </feature>
    <preference name="CordovaWebViewEngine" value="CDVWKWebViewEngine" />
    <engine name="ios" spec="~4.5.2" />
    <plugin name="cordova-plugin-app-version" spec="^0.1.9" />
    <plugin name="cordova-plugin-appavailability" spec="^0.4.2" />
    <plugin name="cordova-plugin-camera" spec="^2.4.1">
        <variable name="CAMERA_USAGE_DESCRIPTION" value="This app would like to access your camera." />
        <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value="This app would like to access your photo library." />
    </plugin>
    <plugin name="cordova-plugin-contacts" spec="^2.3.1">
        <variable name="CONTACTS_USAGE_DESCRIPTION" value="This app would like to access your contacts." />
    </plugin>
    <plugin name="cordova-plugin-device" spec="^1.1.6" />
    <plugin name="cordova-plugin-file" spec="^4.3.3" />
    <plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
    <plugin name="cordova-plugin-geolocation" spec="^2.4.3">
        <variable name="GEOLOCATION_USAGE_DESCRIPTION" value="This app would like to access your location." />
    </plugin>
    <plugin name="cordova-plugin-is-debug" spec="^1.0.0" />
    <plugin name="cordova-plugin-nativestorage" spec="^2.2.2" />
    <plugin name="cordova-plugin-network-information" spec="^1.3.3" />
    <plugin name="cordova-plugin-sim" spec="^1.3.3" />
    <plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
    <plugin name="cordova-plugin-statusbar" spec="^2.2.3" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.2" />
    <plugin name="cordova-plugin-x-socialsharing" spec="^5.2.1" />
    <plugin name="cordova-sqlite-storage" spec="^2.0.4" />
    <plugin name="cordova.plugins.diagnostic" spec="^3.7.1" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.4" />
    <plugin name="cordova-custom-config" spec="^4.0.2" />
    <plugin name="cordova-plugin-themeablebrowser" spec="^0.2.17" />
    <plugin name="cordova-plugin-ionic-webview" spec="^1.1.16" />
    <plugin name="call-number" spec="git+https://github.com/Rohfosho/CordovaCallNumberPlugin.git" />
</widget>

@dalezak
Copy link
Author

dalezak commented Oct 26, 2017

And here's the details from ionic info.

cli packages: (/usr/local/lib/node_modules)

    @ionic/cli-utils  : 1.15.0
    ionic (Ionic CLI) : 3.15.0

global packages:

    cordova (Cordova CLI) : 7.1.0

local packages:

    @ionic/app-scripts : 3.0.0-201710161925
    Cordova Platforms  : ios 4.5.2
    Ionic Framework    : ionic-angular 3.7.1-201710241735

System:

    Android SDK Tools : 26.0.2
    ios-deploy        : 1.9.2
    ios-sim           : 6.1.2
    Node              : v7.2.1
    npm               : 3.10.10
    OS                : macOS Sierra
    Xcode             : Xcode 9.0 Build version 9A235

Environment Variables:

    ANDROID_HOME : /Library/Android

Misc:

    backend : legacy

@sjdrew
Copy link

sjdrew commented Oct 26, 2017

I can confirm same issue and this is fixed in WKWebView, however same display issue persists CDVUIWebViewEngine.

Easy to produce just create blank app and put in home.html

<ion-content > <ion-searchbar showCancelButton=true [debounce]="600" ></ion-searchbar> </ion-content>

And as soon as you tap in the search bar the content moves down about 20px and sometimes when you go back to previous pages they actually bump up under header and partially hidden.

We cannot move to WKWebView until it works properly with cookies (mostly works on device, but always fails on simulator) so we would be grateful to have CDVUIWebViewEngine working again as it used too.

@mhartington
Copy link
Contributor

Hmm, I am unable to replicate at all with ionic-angular 3.8.0 (just released)

@sjdrew
Copy link

sjdrew commented Oct 27, 2017

I tried with 3.8.0, problem still exists.
But note it does not exist on simulator only on real device. Tested with two iPhone 7/7+ both running IOS 11.0.3. And only with CDVUIWebViewEngine.

@metz0r
Copy link

metz0r commented Oct 27, 2017

Also getting this on 3.8.0.

Problem seems to be a style applied to .scroll-content:
padding-top: 20px;
padding-top: constant(safe-area-inset-top);
padding-top: env(safe-area-inset-top);

If you set padding-top: 0 !important it goes away

@mhartington
Copy link
Contributor

Thats not really the proper solution.

So it's only visible if there is no ion-header? That css is only applied when ion-content is the first element. I will test that out.

@mhartington
Copy link
Contributor

Hmm, Im not able to replicate it still. This is looking fine with the latest release.

@sjdrew
Copy link

sjdrew commented Oct 27, 2017

Yes works fine in EMULATOR. Does not work on real device. And I am using default ion-header per start blank project.
(iPhone 7+ with OS 11.0.3 and with CDVUIWebViewEngine.)

@mhartington
Copy link
Contributor

mhartington commented Oct 27, 2017 via email

@sjdrew
Copy link

sjdrew commented Oct 27, 2017

In case it helps, I found that adding no-bounce to ion-content prevents the issue.

Steve.

@sjdrew
Copy link

sjdrew commented Oct 27, 2017

Actually forget that, after cold starting the app with the "no-bounce" it still has the problem.

@dalezak
Copy link
Author

dalezak commented Oct 28, 2017

@mhartington did you try testing on a simulator other than iPhone X?

I've been having my issues on iOS 11 on iPhone SE, iPhone7, etc emulators.

@mhartington
Copy link
Contributor

Yes, I've been using iphone 6/7, but sim and real devices

Sim
keyboard-iphone-6-sim

Device
keyboard-iphone-6-device

If someone can replicate this, please provide a minimal project. Otherwise, Im going to have to close this as I cannot reproduce at all.

@sjdrew
Copy link

sjdrew commented Oct 30, 2017

Here is how I can reproduce it. However for some reason generating a new blank project today it only happens about 1 in 3 tries as opposed to an upgraded one.

  1. create blank starter project

  2. within ion-content tag add a search bar (or any input) <ion-searchbar showCancelButton=true [debounce]="600" >

  3. add to config.xml preference name="CordovaWebViewEngine" value="CDVUIWebViewEngine"

  4. ionic cordova run ios --prod (seemed to happen more with --prod)

See screen shot and notice the cursor flashes above the input field. This is the behaviour I now see in a few apps after upgrading ionic and running ios 11.0.3. Simulator works fine.

img_1017

@mhartington
Copy link
Contributor

Ah, alright @sjdrew so the main issue here is UIWebview. Using WKWebview is the solution to this.

@sjdrew
Copy link

sjdrew commented Oct 30, 2017

I wish it were that easy, have bunch of apps to convert to WKWebView, but still have issues with WKWebView that will take lots of work to workaround and previous cookie handling and app state already in UIWebView so it is not a practical solution.

Is there any workaround that you can think of, I see many people running into this issue as know of many in same situation as us that WKWebview will not work for them.

I did not read anything that said UIWebview was no longer supported as documentation shows how to use either view.

Thanks.

@mhartington
Copy link
Contributor

I wish it were that easy, have bunch of apps to convert to WKWebView,

WKWebview is mostly a drop in replacement for UIWebview, and anything that you need to know is covered in this doc. http://ionicframework.com/docs/wkwebview/

Is there any workaround that you can think of

Unfortunately, we're at the mercy of UIWebview/Apple here. Because it is a Core piece of iOS, we're not able to make any modification to it or change it behaviour. The way to "fix" this is to use WKWebview.

I did not read anything that said UIWebview was no longer supported

You can use UIWebview, but there are several major issues that will come from it. Especially with iOS 11 and the new safe-area margins, which get reported incorrectly (again at the native level so we cannot fix/hack to work).

I will note, I tried this again with UIWebview and a prod build of an app but could not reproduce with the steps provided. It seems very inconsistent (pretty much UIWebview's main issue)

@sjdrew
Copy link

sjdrew commented Oct 30, 2017 via email

@sjdrew
Copy link

sjdrew commented Nov 3, 2017

OK good news. Just upgrade to iOS 11.1 and problem is gone, so far tried many times to reproduce and no display issues. (With UiWebView)

Steve.

@dalezak
Copy link
Author

dalezak commented Nov 14, 2017

@sjdrew @mhartington just some followup.

On one project, upgrading and switching to WKWebview fixed the padding/spacing issue I was experiencing.

However on another project, which sets statusBar.overlaysWebView to true or false in different pages based on whether there is a ion-navbar, the issue still appears to be happening.

So perhaps there is still a lingering issue, with both UiWebView and WKWebview on iOS 11 when used with statusBar.overlaysWebView?

@redgeoff
Copy link

redgeoff commented Dec 7, 2017

Unfortunately, the complications that cordova-plugin-ionic-webview (or WKWebView) creates with cookies, XHR requests, etc... make it a deal breaker. Instead, I fixed this extra spacing by adding viewport-fit=cover to thew viewport meta tag, e.g.

<meta name="viewport" content="viewport-fit=cover, initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">

For more info see https://issues.apache.org/jira/browse/CB-12886 & #13208 and

@anjildhamala
Copy link

my two cents to this issue:

I have WKWebView plugin installed. I was still seeing this
padding-top: calc(16px + 20px) in the web inspector.

To fix this, all I did was move padding attribute from <ion-content> to scroll-content as

.scroll-content {
padding: 16px;
}

and I did observe the issue again in any ios versions or model (including iphone X).

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 1, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 1, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants