cordova-plugin-ionic-webview icon indicating copy to clipboard operation
cordova-plugin-ionic-webview copied to clipboard

iOS 12.2 scroll hangs

Open BumbleeLin opened this issue 5 years ago • 63 comments

Our app seems to have the scrolling hang on certain pages. In the CDVWKWebViewEngine.m file on the (void)handleStopScroll method when I change the last line from -

a) [wkWebView evaluateJavaScript:@"window.IonicStopScroll.fire()" completionHandler:nil];

To -

b) [wkWebView evaluateJavaScript:@"window.IonicStopScroll.cancel()" completionHandler:nil];

The scrolling then seems to work. I'm not sure if there is an issue with this section in the wk-plugin.js file -

 var stopScrollFunc = null;
  var stopScroll = {
    stop: function stop(callback) {
      if (!stopScrollFunc) {
        stopScrollFunc = callback;
        stopScrollHandler.postMessage('');
      }
    },
    fire: function fire() {
      stopScrollFunc && stopScrollFunc();
      stopScrollFunc = null;
    },
    cancel: function cancel() {
      stopScrollFunc = null;
    }
  };

  window.Ionic.StopScroll = stopScroll;
  // deprecated
  window.IonicStopScroll = stopScroll;

BumbleeLin avatar Mar 04 '19 12:03 BumbleeLin

@BumbleeLin - do you happen to have reproduction steps & a sample application that exhibits the issue?

I'm working with someone on a similar issue, but haven't yet experienced this issue myself. If you have the chance to write up a simple demo app and post that here, that'd be great!

Edit: Additionally, if you can post more information about your app environment (post the outputs of ionic info and cordova plugin ls), that'd be great.

bryplano avatar Mar 04 '19 16:03 bryplano

@Baadier-Sydow you're also welcome to post a sample application if this is an issue for you :) we're trying to look into it but have no viable reproduction steps / sample app at the moment.

bryplano avatar Mar 05 '19 14:03 bryplano

@bryplano awesome. I will try to help with a sample app. See below the Ionic info:

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

@ionic/cli-utils  : 1.19.2
ionic (Ionic CLI) : 3.20.0

global packages:

cordova (Cordova CLI) : 8.0.0

local packages:

@ionic/app-scripts : 3.1.6
Cordova Platforms  : android 6.2.2 ios 4.5.5
Ionic Framework    : ionic-angular 3.6.0

System:

ios-deploy : 1.9.4
Node       : v8.11.4
npm        : 6.4.1
OS         : macOS
Xcode      : Xcode 9.4.1 Build version 9F2000

Environment Variables:

ANDROID_HOME : not set

Misc:

backend : pro

---------------------------->

Below is the plugin list :

com-sarriaroman-photoviewer 1.1.10 "PhotoViewer" cordova-plugin-actionsheet 2.3.1 "ActionSheet" cordova-plugin-camera 2.4.1 "Camera" cordova-plugin-compat 1.1.0 "Compat" cordova-plugin-console 1.1.0 "Console" cordova-plugin-device 1.1.3 "Device" cordova-plugin-fcm 2.1.2 "FCMPlugin" cordova-plugin-geolocation 2.4.1 "Geolocation" cordova-plugin-inappbrowser 2.0.2 "InAppBrowser" cordova-plugin-ionic-webview 4.0.0 "cordova-plugin-ionic-webview" cordova-plugin-network-information 1.3.3 "Network Information" cordova-plugin-splashscreen 4.0.0 "Splashscreen" cordova-plugin-statusbar 2.2.0 "StatusBar" cordova-plugin-velda-devicefeedback 0.0.2 "DeviceFeedback" cordova-plugin-whitelist 1.3.0 "Whitelist" cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin" cordova.plugins.diagnostic 3.6.5 "Diagnostic" ionic-plugin-keyboard 2.2.1 "Keyboard" uk.co.workingedge.phonegap.plugin.launchnavigator 3.2.1 "Launch Navigator"

I will continue to dig deeper into this issue and let you know if I have any updates.

BumbleeLin avatar Mar 05 '19 14:03 BumbleeLin

@BumbleeLin awesome! Thank you so much :) we're working on it from our end as well, so we'll be sure to update if we find anything.

bryplano avatar Mar 05 '19 15:03 bryplano

Here is a sample app that shows the behavior: https://github.com/kensodemann/test-scroll

Run on a phone that is running iOS 12.2 Beta 4

On home, press the button, which opens a child that will not scroll. Make the change that @BumbleeLin specifies in the original post and rebuild Now the scroll works when the child page is navigated to

kensodemann avatar Mar 05 '19 18:03 kensodemann

@bryplano I'm on the same team as @BumbleeLin

Unfortunately the project is too large for us to create something reproducible as we arent sure on the root cause. It seems like @kensodemann may have something that can help.

Baadier-Sydow avatar Mar 05 '19 18:03 Baadier-Sydow

@kensodemann @bryplano What @BumbleeLin didnt mention is that even after that change we have one or two screens that still dont work. We are going to see if we can find the root cause but arent really making any headway.

Baadier-Sydow avatar Mar 05 '19 18:03 Baadier-Sydow

@Baadier-Sydow no problem! Thanks for clarifying and thanks to @kensodemann for the demo app.

We're taking a look at this on our end and will post once we have any update.

bryplano avatar Mar 05 '19 18:03 bryplano

I wrote up a separate issue for the Ionic v3 repo: https://github.com/ionic-team/ionic-v3/issues/984

Probably best to follow both issues as last I checked, the team is working on determining where a fix would come from. Suspicion is a Webkit / Safari issue but still working it out :)

bryplano avatar Mar 07 '19 23:03 bryplano

I'm going to add another issue that was up by one our testers both here and on the v3 repo as it could be linked. We have a feature that opens an external site in an inappbrowser and then returns back to the application.

We started with the Ionic side menu starter and according to the testers the menu intermittently stops responding to the press to open it ie the menu does not slide open when we get focus back from the inappbrowser.

This was working prior to iOS 12.2.

Baadier-Sydow avatar Mar 08 '19 04:03 Baadier-Sydow

I think it has been fixed on 12.2 beta 6

jcesarmobile avatar Mar 20 '19 12:03 jcesarmobile

@BumbleeLin - I have closed my issue on the v3 repo because the problem no longer exists after installing iOS 12.2 Beta 6 (released earlier this week).

Reference: https://github.com/ionic-team/ionic-v3/issues/984

Could you check and see if you still have issues?

bryplano avatar Mar 20 '19 12:03 bryplano

Thanks @bryplano @BumbleeLin and I will have a look 👍

Baadier-Sydow avatar Mar 20 '19 12:03 Baadier-Sydow

@bryplano cool bro, will give you feedback on this

BumbleeLin avatar Mar 20 '19 14:03 BumbleeLin

@bryplano yo man, I'm still not having any luck with the scroll issue. Do you perhaps have any other suggestions? I have updated the device to iOS 12.2 beta 6 and used XCode 10.2 beta 4.

BumbleeLin avatar Mar 26 '19 07:03 BumbleeLin

@BumbleeLin - I'd recommend updating to the iOS 12.2 GA release and Xcode 10.2 GA release as well.

Do you have a simple sample application that exhibits this behavior? Beyond that, does the scroll issue occur with and without cordova-plugin-ionic-webview installed?

Apple has made some changes to Webkit as part of this 12.2 release (which we found out was causing the scrolling issue I mentioned in my previous post), so it could be there are other weird issues there too.

bryplano avatar Mar 26 '19 12:03 bryplano

@bryplano thanks. I'm busy with the update at the moment. I will let you know once I have done this. Thanks!

BumbleeLin avatar Mar 26 '19 12:03 BumbleeLin

Did you solve this issue? I'm getting the exact same behavior as described in ionic-team/ionic-v3#984.

I tried updating/upgrading several packages with no luck so far...

phpfs avatar Mar 27 '19 16:03 phpfs

@phpfs we still havent been able to test. @BumbleeLin and I are having issues with the latest update to Xcode. But, we'll update here as soon as we know more.

Baadier-Sydow avatar Mar 27 '19 16:03 Baadier-Sydow

I'm experiencing this issue as well on the simulator and device. I'm using Ionic v3 and XCode 10.2.

daviddickson avatar Mar 28 '19 12:03 daviddickson

Do you have a simple sample application that exhibits this behavior? Beyond that, does the scroll issue occur with and without cordova-plugin-ionic-webview installed?

Apple has made some changes to Webkit as part of this 12.2 release (which we found out was causing the scrolling issue I mentioned in my previous post), so it could be there are other weird issues there too.

@daviddickson, have you seen if this occurs without the webview plugin installed (per my previous comment)? It would be worth trying to reproduce the problem in a simple sample application - like I said, with the Webkit changes in 12.2, I wouldn't be surprised if this is actually a Webkit bug, but it could be an issue with ionic-webview too... would like to try and determine that :)

bryplano avatar Mar 28 '19 13:03 bryplano

@bryplano Thank you for the quick response. I appreciate it. I just created a sample app with the webview plugin installed and with the html where I'm experiencing the issue but I'm not able to reproduce it in the sample app.

daviddickson avatar Mar 28 '19 14:03 daviddickson

@daviddickson can you show your plugin list?

BumbleeLin avatar Mar 28 '19 14:03 BumbleeLin

In the sample app:

    <plugin name="cordova-plugin-whitelist" spec="1.3.3" />
    <plugin name="cordova-plugin-statusbar" spec="2.4.2" />
    <plugin name="cordova-plugin-device" spec="2.0.2" />
    <plugin name="cordova-plugin-splashscreen" spec="5.0.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^3.0.0" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.0.5" />

daviddickson avatar Mar 28 '19 14:03 daviddickson

In the app where I'm experiencing the issue:

    <plugin name="cordova-plugin-device" spec="^2.0.2" />
    <plugin name="cordova-plugin-ionic-keyboard" spec="^2.1.2" />
    <plugin name="cordova-plugin-ionic-webview" spec="^2.1.4" />
    <plugin name="cordova-plugin-splashscreen" spec="^5.0.2" />
    <plugin name="cordova-plugin-statusbar" spec="^2.4.2" />
    <plugin name="cordova-plugin-whitelist" spec="^1.3.3" />
    <plugin name="cordova-sqlite-storage" spec="2.5.2" />
    <plugin name="cordova-plugin-network-information" spec="2.0.1" />
    <plugin name="cordova-plugin-app-version" spec="0.1.9" />

daviddickson avatar Mar 28 '19 14:03 daviddickson

Maybe bump you webview plugin to sample app version?

BumbleeLin avatar Mar 28 '19 14:03 BumbleeLin

I removed it using ionic cordova plugin remove and re-added. It added at version 4.0.1. Still experiencing the issue.

daviddickson avatar Mar 28 '19 14:03 daviddickson

@daviddickson kak me too. No luck with Xcode 10.2.

BumbleeLin avatar Mar 28 '19 14:03 BumbleeLin

I tried installing @3 which installed 3.1.2 and tried installing specifically 3.0.0. Neither worked.

daviddickson avatar Mar 28 '19 14:03 daviddickson

@BumbleeLin I can confirm the fix you put in the initial post works for me.

daviddickson avatar Mar 28 '19 14:03 daviddickson