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

Scrolling trouble on UIWebView since 2.3.0 #11086

Closed
Manduro opened this issue Apr 6, 2017 · 13 comments
Closed

Scrolling trouble on UIWebView since 2.3.0 #11086

Manduro opened this issue Apr 6, 2017 · 13 comments
Assignees

Comments

@Manduro
Copy link
Contributor

Manduro commented Apr 6, 2017

Ionic version:
[x] 2.x / 3.x

I'm submitting a ...
[x] bug report

Current behavior:
Before 2.3.0 (specifically, before 7e9bad5), js scrolling was used on UIWebView, but only for the virtual scroll component.

Since 2.3.0, up to current master, js scrolling is enabled on every scroll view when using UIWebView. This causes a lot of other functionality to malfunction (InfiniteScroll, Pull to refresh, scrollToX(), etc.). This is because they track scroll position using content.getContentDimensions(), which gets its scrollTop from the scroll element. But, when using js scrolling, its scrollTop is always zero, because scrolling is done using a transform.

Expected behavior:
Latest Ionic should behave like 2.2.0 on UIWebView.

Steps to reproduce:
Run Ionic's own InfiniteScroll e2e test in a UIWebView, and you'll see it doesn't work.

Related code:
pre 2.3.0, js scrolling is enabled here in virtual-scroll.ts.

if (this._config.getBoolean('virtualScrollEventAssist')) {
  this._content.enableJsScroll();
}

post 2.3.0, js scrolling is enabled here in content.ts's constructor:

const jsScroll = config.getBoolean('virtualScrollEventAssist');
this._scroll = new ScrollView(_app, _plt, _dom, jsScroll);

This changed in this commit: 7e9bad5

Other information:
Issues caused by this regression:
#11081
#10976
#10966
#10936
#11051
#10889

There are probably more of them out there. Some have been closed but weren't really fixed in 3.0.0.

@manucorporat
Copy link
Contributor

This is the first time it is reported as an UIWebView only issue... it was my fault though

I am working in a good fix for UI right now. What is stoping you to use WKWebView? We have plans to deprecate UI very soon, making WK the default option.

@manucorporat manucorporat self-assigned this Apr 6, 2017
@manucorporat
Copy link
Contributor

@Manduro could try this nightly release?

  • ionic-angular@3.0.0-201704061344

@Manduro
Copy link
Contributor Author

Manduro commented Apr 6, 2017

@manucorporat Yeah took me long enough to figure it out as well, but it was working on mobile safari so that's how I found out ;). Thanks for the quick fix. It seems to be working fine again on first sight.

Is it possible that the 300ms tap delay has returned though? (only on UIWebView as well)

I've tried WKWebView around the v2 beta's I think, but I ran into some minor issues. It's on my list to give it another go soon. The most significant was that I couldn't get autofocus to work anymore, which I believe is a known WK limitation. Any other issues I ran into have probably been solved in Ionic by now.

Thank you for your amazing work on Ionic :)

@manucorporat
Copy link
Contributor

@Manduro when did the 300ms click delay regression happen? updating to 3.0?

@Manduro
Copy link
Contributor Author

Manduro commented Apr 6, 2017

@manucorporat Just checked, 3.0 non-nightly has the delay as well. 2.2 didn't, not sure about 2.3.

@rossholdway
Copy link
Contributor

@manucorporat I'm pretty sure I'm seeing the delay also when running the nightly.

@Manduro
Copy link
Contributor Author

Manduro commented Apr 6, 2017

Just noticed there's an issue about this: #10935.

So I'm closing this one 🎉

@Manduro Manduro closed this as completed Apr 6, 2017
@manucorporat
Copy link
Contributor

manucorporat commented Apr 6, 2017

@rossholdway @Manduro I can confirm the delay. I am working a new fix and a new nightly

@manucorporat
Copy link
Contributor

@rossholdway @Manduro
here's the fix: 32094f7

and a new nightly: + ionic-angular@3.0.0-201704061551

can you please try it really quick? thanks!

@Manduro
Copy link
Contributor Author

Manduro commented Apr 6, 2017

@manucorporat Works here, awesome!

@rossholdway
Copy link
Contributor

@manucorporat Looks good here too 👍

@engehabahmed
Copy link

Thanks too muck , you saved my day :) <3

@ionitron-bot
Copy link

ionitron-bot bot commented Sep 3, 2018

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Sep 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants