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

Can't scroll on iOS #217

Closed
2peter3 opened this issue Jan 13, 2018 · 9 comments
Closed

Can't scroll on iOS #217

2peter3 opened this issue Jan 13, 2018 · 9 comments

Comments

@2peter3
Copy link

2peter3 commented Jan 13, 2018

I'm submitting a...

[X] Bug report
[ ] Feature request
[ ] Documentation issue or request

Current behavior

Can't scroll on iOS

Expected behavior

Scrolling :)

Minimal reproduction of the problem with instructions

Installing a fresh version with this Settings:

? What's the name of your app? bb
? What kind of app do you want to create? Web app, Mobile app (using Cordova)
? Do you want a progressive web app? (with manifest and service worker) Yes
? Which mobile platform do you want to support? iOS
? Which UI framework do you want? Bootstrap (more website-oriented)
? Do you want authentication? Yes

After this prepare cordova with:
npm run cordova:prepare

Now add some long text to src/app/home/home.component.html

example:

...
        </h1>
        <br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br
        />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />t<br />kkkkkkkkkk
        <app-loader [isLoading]="isLoading"></app-loader>
....

and build cordova with
npm run cordova:build

Go to XCode, Open Project and Select the Developer Team and Run it on Device.

Scrolling wont work, so nobody wont see "kkkkkkkkkk"

Environment

- generator version: v3.1.1
- node version: v9.3.0
- npm version: 5.6.0
- OS:  Mac

Others:

@sinedied sinedied added the bug label Jan 15, 2018
@sinedied
Copy link
Member

I can reproduce the issue on the simulator. Did you also try it on a real device? (I don't have one at hand)

@2peter3
Copy link
Author

2peter3 commented Jan 15, 2018

Yes, i have tested it on real device iPhone 6s and Simulator :/

@2peter3
Copy link
Author

2peter3 commented Jan 15, 2018

you have any ideas/hints what could be the problem?

@sinedied
Copy link
Member

sinedied commented Jan 15, 2018

Thanks for feedback for the real device test.
I'm currently trying to isolate the issue, I think it's something in Bootstrap that's causing the issue as the problem do not exist when using Ionic or Angular Material.
I am trying the latest Bootstrap beta branch to see if it fixes the issue, I'll keep you updated if I find something.

@sinedied
Copy link
Member

Same behavior with latest Bootstrap beta, it seems that there's an element capturing the scrolling event, still investigating...

@sinedied
Copy link
Member

Removing cordova-plugin-ionic-webview with ngx cordova plugin rm cordova-plugin-ionic-webview fixes the issues, but changes the webview to the slower UIWebView instead of WKWebView.

I will try with the official cordova WKWebView plugin to see if it works or not.

@sinedied sinedied changed the title Can't scrolling on iOS Can't scroll on iOS Jan 15, 2018
@2peter3
Copy link
Author

2peter3 commented Jan 19, 2018

i think i have found a solution... add to config.xml

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

between "" and

@sinedied could you approve it?

i tested this with simulator on Xcode 9.2 and iPhone 6s (latest updates) and it works

@sinedied
Copy link
Member

I cannot test it at the moment, but it seems a viable fix, seeing https://github.com/ionic-team/cordova-plugin-ionic-webview/blob/master/src/ios/CDVWKWebViewEngine.m#L377

I could not find a documentation for this setting anywhere though, so I'm unsure of the reason for the default value being false. What's even more strange is that in previous cordova-plugin-ionic-webview version scrolling was working fine even without this settings 😕

Thanks for finding this fix, I'll add it specifically for the mobile/Bootstrap generation path since it's not needed when using Ionic or Angular Material 👍

@sinedied
Copy link
Member

@2peter3 I just tested the workaround, the scrolling works as expected.
You may also want to change <preference name="UIWebViewBounce" value="false" /> with the true value to restore native webview bounce when scrolling.

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

No branches or pull requests

2 participants