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
fix(5907): webview bouncing issue on ios 16 #5909
base: main
Are you sure you want to change the base?
Conversation
Can you provide a video or gif of the behavior before and after the change? |
I can confirm the fix works. Would be great if you got this merged. |
Tested on the simulator and the bouncing seems to be fixed (haven't tested on a physical device tho) |
Could we get some videos or gifs of the problem behavior? We are thinking this may be a 16.0 issue and could be fixed in 16.1, so I'd also recommend testing with the current iOS Beta |
It is not fixed on iOS 16.1 Developer Beta. Video from a real device (iPhone 14 Pro): https://imgur.com/a/40XFTc0 |
How do I install this branch? |
@rpanadero Do you use your fork internally? How can we use it? |
@Sharcoux no, I don't. As a temporal fix until this PR is merged/reviewed, I developed an ad-hoc plugin for my project that changes the Capacitor webview configuration. Just add these two files to your iOS project: WebViewPlugin.m
WebViewPlugin.swift
After adding/creating them to your iOS project, be sure that the files are included in the bundle resources. |
@rpanadero thank you very much this works for me! If anybody reading this and don't know how to put this in practice:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks for the instructions @rpanadero and @IJustDev! I can't seem to get web view bounce to stop. I have created both files in the same dir as the AppDelegate.swift - I'm sure this is my fault for missing something Do I need to create a bridging file or anything? I can see the Xcode project has changed and the files are present in my Appreciate all your efforts on this, thanks so much 🙌 |
Do these files appear in XCode? |
Yep, the files appear as expected in XCode I also experimented by adding:
to my |
The above code didn't work, so creating an object c file with the below code worked for me: #import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@implementation UIScrollView (NoBounce)
- (void)didMoveToWindow {
[super didMoveToWindow];
self.bounces = NO;
}
@end Found this code here: #1169 (comment) So maybe moving this piece of code inside |
Can’t get any of the above snippets to work to solve the problem. How can I check if added files get included in the bundle? |
This is not an issue anymore on iOS 16.2 |
Gotcha. Can confirm that this is fixed in iOS 16.2. |
@thoasty-dev You say it is fixed on ios 16.2 but i can't understand what is the expected behaviour. Is bouncing automatically disabled in capacitor apps by default ? (i don't think so as bouncing is ON on my ios 14 iphone) Or, does it need any configuration/code to disable it ? If yes, which one ? |
Will this ever be merged? |
Fixes issue #5907