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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: wkwebview bouncing issue on iOS 16 #5907

Open
rpanadero opened this issue Sep 13, 2022 · 15 comments
Open

bug: wkwebview bouncing issue on iOS 16 #5907

rpanadero opened this issue Sep 13, 2022 · 15 comments
Labels
platform: ios type: bug A confirmed bug report

Comments

@rpanadero
Copy link

rpanadero commented Sep 13, 2022

Bug Report

Capacitor Version

馃拪   Capacitor Doctor  馃拪 

Latest Dependencies:

  @capacitor/cli: 4.2.0
  @capacitor/core: 4.2.0
  @capacitor/android: 4.2.0
  @capacitor/ios: 4.2.0

Installed Dependencies:

  @capacitor/android: not installed
  @capacitor/core: 4.2.0
  @capacitor/ios: 4.2.0
  @capacitor/cli: 4.2.0

[success] iOS looking great! 馃憣

Platform(s)

  • iOS

Current Behavior

The webview bounces when the user slides down the view. I have checked the webview config and bouncing effect is disabled, but it seems it doesn't work.

Only reproduced on a physical iOS device with iOS 16.

Expected Behavior

The webview shouldn't bounce when the user slides down the app view.

Code Reproduction

https://github.com/rpanadero/demo-bouncing

Only reproduced on a physical iOS device with iOS 16.

Other Technical Details

npm --version output: 8.19.1

node --version output: v18.9.0

pod --version output (iOS issues only): 1.11.3

Additional Context

This bug was already reported as an iOS 16 issue on Apple forum one month ago, but it seems not to be fixed yet. Maybe, Apple will fix it in some days or months.

https://developer.apple.com/forums/thread/711601

Until Apple fixes the issue, we suggest to apply the workaround commented in this thread because the change is centralized and can be easily reverted when Apple fixes the real issue, if Capacitor team desires. The workaround consist on setting 'alwaysBounceVertical' webview property to false. Also, we have tested that the bug is still present on iOS 16 final release and the workaround still works.

We think that this change should be applied on Capacitor core code because this behaviour is undesired for all Capacitor iOS apps. In fact, webview bouncing is already disabled here:

https://github.com/ionic-team/capacitor/blob/76f28e70a5c0a03e4c6b9a93a0c068666a2c38ff/ios/Capacitor/Capacitor/CAPBridgeViewController.swift

aWebView.scrollView.bounces = false

@philmmoore
Copy link

+1 on this. Seeing the same thing in iOS16 on physical devices

@mcfarljw
Copy link

mcfarljw commented Oct 3, 2022

I am also able to reproduce this using iPhone 13/14 simulators running iOS 16.

@msoler95
Copy link

msoler95 commented Oct 6, 2022

+1 here, any solution?

@mcfarljw
Copy link

mcfarljw commented Oct 6, 2022

@rpanadero did you find a way to override this without needing to edit the core Capacitor project?

@jcesarmobile jcesarmobile added the type: bug A confirmed bug report label Oct 6, 2022
@fabltd
Copy link

fabltd commented Oct 17, 2022

Any fix?

@fabltd
Copy link

fabltd commented Oct 17, 2022

There is some talk of a fix here for Cordova. Is this possible to port to Cap?

apache/cordova-ios#1244

@webuniverseio
Copy link

It looks like this fix helps with webview freezing for a bit if user tries to scroll (and continue trying to scroll) after bounce effect.

@jonesdhtx
Copy link

馃憖

@jonesdhtx
Copy link

jonesdhtx commented Oct 26, 2022

Actually the following capacitor config fixed it for me...

ios: {
  scrollEnabled: false
}

@mcfarljw
Copy link

mcfarljw commented Oct 27, 2022

Actually the following capacitor config fixed it for me...

ios: {
  scrollEnabled: false
}

This will also prevent native webview scrolling entirely (see https://developer.apple.com/documentation/uikit/uiscrollview/1619395-isscrollenabled).

@24jr
Copy link

24jr commented Nov 3, 2022

@mcfarljw that stopped the bounce but also my body isnt scrolling now. Not sure if need to somehow do some sort of nested internal scroll. I think this is what those docs indicate. I'll prob just not do that and deal with bounce for now...

@cironapo
Copy link

cironapo commented Nov 6, 2022

I have same problem. Any fix?

@Sharcoux
Copy link

The PR solving this is here. A quick merge would be very appreciated.

@BenRacicot
Copy link

I couldn't get any of the native code to work but the actual capacitor.config.ios values fixed this for me.

"ios": {
    "contentInset": "always", <-- the cause
}

@e-peeyush
Copy link

++++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: ios type: bug A confirmed bug report
Projects
None yet
Development

No branches or pull requests