Friday 6 September 2019

iOS: Page with iframe does not scroll in WKWebView

In my app I am displaying website using the WKWebView component but since the website has <iframe> content, scrolling does not work. The iframe content itself registers taps and swipes but it never scrolls.

When I open the same page with Safari it works well, I can interact with iframe's content and scroll without any issues.

My iframe takes full width and height of the webpage and I added this property:

-webkit-overflow-scrolling: touch;

But it does not help. Unfortunately I cannot show the webpage in question because it contains proprietary data and is behing login screen.

I would prefer to solve this without having to modify the webpage, since Safari works fine.

EDIT: It looks like the iframe might be detecting the events and not "forwarding" them, because when there is also for example navbar on the page (that is not part of the iframe) I can swipe it and scroll. However since there is very little space on the screen, I would prefer not to have any other elements apart from iframe itself.



from iOS: Page with iframe does not scroll in WKWebView

No comments:

Post a Comment