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

iOS 12.2 scroll hangs #326

Open
BumbleeLin opened this issue Mar 4, 2019 · 63 comments
Open

iOS 12.2 scroll hangs #326

BumbleeLin opened this issue Mar 4, 2019 · 63 comments

Comments

@BumbleeLin
Copy link

BumbleeLin commented Mar 4, 2019

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;
@bryplano
Copy link

bryplano commented Mar 4, 2019

@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
Copy link

bryplano commented Mar 5, 2019

@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.

@BumbleeLin
Copy link
Author

@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.

@bryplano
Copy link

bryplano commented Mar 5, 2019

@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.

@kensodemann
Copy link
Member

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

@Baadier-Sydow
Copy link

@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
Copy link

@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.

@bryplano
Copy link

bryplano commented Mar 5, 2019

@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
Copy link

bryplano commented Mar 7, 2019

I wrote up a separate issue for the Ionic v3 repo: ionic-team/ionic-v3#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 :)

@Baadier-Sydow
Copy link

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.

@jcesarmobile
Copy link
Member

I think it has been fixed on 12.2 beta 6

@bryplano
Copy link

@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: ionic-team/ionic-v3#984

Could you check and see if you still have issues?

@Baadier-Sydow
Copy link

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

@BumbleeLin
Copy link
Author

@bryplano cool bro, will give you feedback on this

@BumbleeLin
Copy link
Author

@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.

@bryplano
Copy link

@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.

@BumbleeLin
Copy link
Author

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

@phpfs
Copy link

phpfs commented Mar 27, 2019

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...

@Baadier-Sydow
Copy link

@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.

@daviddickson
Copy link

daviddickson commented Mar 28, 2019

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

@bryplano
Copy link

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 :)

@daviddickson
Copy link

@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.

@BumbleeLin
Copy link
Author

@daviddickson can you show your plugin list?

@daviddickson
Copy link

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
Copy link

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" />

@BumbleeLin
Copy link
Author

Maybe bump you webview plugin to sample app version?

@daviddickson
Copy link

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

@BumbleeLin
Copy link
Author

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

@daviddickson
Copy link

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

@daviddickson
Copy link

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

@BumbleeLin
Copy link
Author

@phpfs is the fix a work around for now?

@BumbleeLin
Copy link
Author

BumbleeLin commented Mar 29, 2019

@daviddickson this fix works - ionic-team/ionic-v3#989

@daviddickson
Copy link

daviddickson commented Mar 29, 2019

@phpfs

Currently the app I'm working on is at the finish line for a MVP and I'm hesitant to make environment/Ionic CLI changes because I'm not comfortable with the inner workings of what's going on here.

That being said would a step by step walkthrough of what you said look like this? -

  1. Backup - as in make a copy of the folder?
  2. npm uninstall ionic-angular (from within the project)
  3. npm install ionic-angular (at a specific version?)
  4. npm uninstall -g ionic
  5. npm install -g ionic@3

@phpfs
Copy link

phpfs commented Mar 29, 2019

@daviddickson
EDIT: Didn't work for me...

@phpfs
Copy link

phpfs commented Mar 29, 2019

@daviddickson Did you have any luck?

@daviddickson
Copy link

@phpfs I haven't tried. I'm going to hold off.

@wilk-polarny
Copy link

@daviddickson , the fix should be within ionic-angular nightly build 3.9.4-201903121725 as far as I know

@BumbleeLin
Copy link
Author

@daviddickson if the initial fix works for you then I think you should be safe. I also don't think that you need to update your version of Ionic to get the fix, you can manually apply the code that fixes it from the Ionic V3 repo. If you want to take the latter approach then let me know I can help you with that :)

@daviddickson
Copy link

@BumbleeLin I'm just going to stick with the initial fix for now. Thanks for offering to help. :)

@phpfs
Copy link

phpfs commented Apr 3, 2019

ionic-team/ionic-v3#984 (comment)

@simlevesque
Copy link

Does anyone know how to fix this if I use this plugin inside a ionic-less cordova app ? I'm open to any kind of solution.

@BumbleeLin
Copy link
Author

@simlevesque please see first comment in issue

@filippodicostanzo
Copy link

I have the same issue. Any solution or workaround for this problem?

@phpfs
Copy link

phpfs commented Apr 4, 2019

See my comment above: If you use ionic, follow ionic-team/ionic-v3#984 (comment) :)

@filippodicostanzo
Copy link

filippodicostanzo commented Apr 4, 2019

i've installed this specific version of ionic npm i ionic-angular@3.9.4-201903121725
but doesn't work

@BumbleeLin
Copy link
Author

After updating try to rebuild your project or platforms

@filippodicostanzo
Copy link

Ok i will try and I'll let you know.
Thank You!

@filippodicostanzo
Copy link

I've tried with rebuild and re-added platform but doesn't work. :|
If is in page there is an event the scroll it work otherwise doesnt' work.

Any solution?

@BumbleeLin
Copy link
Author

BumbleeLin commented Apr 5, 2019

@filippodicostanzo Okay try below, if it doesn't work then you are more than welcomed to contact me directly :

In Xcode > Plugins/CDVWKWebViewEngine.m file on the (void)handleStopScroll method change the last line from -

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

To -

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

@filippodicostanzo
Copy link

filippodicostanzo commented Apr 5, 2019

@BumbleeLin yes I tried this too but it doesn't work.

How to contact directly?

The testing is very fast.
Just start a new blank project of ionic v3 with sidemenu options

ionic cordova add platform ios
ionic cordova build ios

just run on a real device and if you change the page from menu the scroll of page doesnt' work.

I repeat the problem only occurs on devices with iOS 12.2

@JoeMeeks
Copy link

JoeMeeks commented Apr 16, 2019

This totally solves it for me. Add this to your scss:

ion-app.platform-ios12 ion-content { pointer-events: auto; /*fix scroll lock on ios12.2*/ }

@MeterMoDev
Copy link

This totally solves it for me. Add this to your scss:

ion-app.platform-ios12 ion-content { pointer-events: auto; /*fix scroll lock on ios12.2*/ }

Confirmed as working for me! Really appreciate it.

@emanzuetaj
Copy link

This totally solves it for me. Add this to your scss:

ion-app.platform-ios12 ion-content { pointer-events: auto; /*fix scroll lock on ios12.2*/ }

This works great, but I'm having the same issue on action sheets and adding the same css to .action-sheet-group doesn't help

@ashgibson
Copy link

FYI I had an issue on Ionic3 with webview and i removed these dependencies and the issue was fixed:

"@ionic-native/ionic-webview": "^5.0.0",
"cordova-plugin-ionic-webview": "^4.0.0",

@50l3r
Copy link

50l3r commented Jan 13, 2020

I have similar issue. Scroll works but keep sticky in ios 12.2

#495

@Sampath-Lokuge
Copy link

This works for me. i.e ion-scroll

<ion-content>

  <ion-scroll scrollY="true">
  <ion-list>
   
        
  </ion-list>
</ion-scroll>
</ion-content>

.css

  ion-scroll {
        white-space: nowrap;
        height: 700px;
    }

@carlosromanmena
Copy link

Add this line to your config.xml file:

<preference name="ScrollEnabled" value="true" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests