Problem with -webkit-overflow-scrolling: touch


Harald Schneider

I have a strange problem getting the smooth scrolling on iOS working properly.

When I load a view with a long text in a HTML control, I can scroll smoothly directly after the view shows up. After approx 1 second, the scroll position jumps to the top and the touch scrolling effect stops working.

All content is enclosed with this wrapper:

Any hints ?


DecSoft

Hello Harald,

Probably a sample of what you are doing is required here. I am not sure what the "wrapper" is, for example. My recomendation, however, is that you use an HTML control to place more or less larger text or content. If we place an HTML control, and set their CSS "overflow-y" to "auto", then the scroll appear automatically. Maybe you can apply the "-webkit-overflow-scrolling" rule to that HTML control, but maybe this is not really required... at least I don't remember to use it,... but I use in certain app various Reports and HTML controls in the described way, without problems.



DecSoft

Hello Harald,

More information about this... I remember now... and check it... that the HTML and Report controls already uses the "-webkit-overflow-scrolling: touch"... AB defines a CSS class named "ios-inertial-scroll", and, it's automatically assigned to HTML and Report controls.



Harald Schneider

Hi Davide

For some reason, the touch scrolling seems to be applied and then removed after a second. Maybe some Angular event mechanism does something behind the scene ...

I will send you the project by mail - maybe you can reproduce it. I already removed my custom CSS an all JS code, but it makes no difference.


DecSoft

Hello Harald,

I don't bet for Angular here... but the point is what kind of content its shown... I don't know... what I can say is that I have an iOS app which uses HTML and Report controls by just the "overflow-y" in "auto", and, the referred CSS rule for iOS... and there work as expected... Anyway, send the me a sample of the possible issue and I will try to take a look.



Harald Schneider
Just sent it. Thanks !

DecSoft

Hello Harald,

I want to take a look at the sample when possible. I already send to you another sample, and, want to place it here too, so other interested user can try it in AB if he wanted.

Copy the above XML into a file and save it as "MyApp.ab". Open this file with AB and just run it.



Harald Schneider

Hi.

splitting the divs into separate HTML controls unfortunately made no difference.

I think I ran into some strange Cordova, Webkit or XCode bug in conjunction with nested divs or some CSS code:

The same code runs perfectly as a PWA on the iPhone. As soon as I run it as a native app the problem reappears ... :-/


DecSoft

Hello Harald,

You refer to your sample or to my sample? Take my sample also as a possible workaround... because as I told you before (via E-Mail?) probably it's the CSS that you are using in your sample who can cause the issue. In other words, if you see my sample working, maybe it's because it's quite more simple, but, since it works (at least we don't receive any complain), maybe you can adapt your content to it... that is... using my sample approach... in order to do what you want to do, instead to try to use the other way.

Anyway I want to take a look when possible to your sample in an iOS emulator (it's all what I can do... since I don't have an iOS device right now) and maybe see it with my own eyes give me another idea or something...



Harald Schneider

Its about my sample, yours works perfectly out of the box. I thinks you hit the point: It is the complexity of nested DIVs and / or some CSS problem.

You can save your time, because my code also runs perfectly in the simulator. The prob only appears on the hardware.

Thanks for pointing to the right direction!


Harald Schneider

I was able to find and kill this nasty, ugly, time eating bug :-)

The problem wasn't a Cordova, Webkit, CSS nor a nested DIV issue. It was this string:

Telefon: 06861 792145

Why did that happen?

The super-duper smart iPhone translates phone numbers in dial-able phone URLs. This happens approx. 1 sec after the page loaded, interrupts the touch scrolling and obviously blows away the CSS code, which causes a normal scrolling instead of fast and smooth touch scrolling.

The solution: Use phone URLs by default:


DecSoft

OMG... thanks very much to post it here, Harald... may can help to someone in the future!


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.