iOS - iframe is capturing scroll events even though it doesn't need to scroll
My page is composed of one iframe and some extra content that overflows the viewport
When the user tries to scroll on the iframe, the scrolling event is triggered inside the iframe and, for security reasons, the parent window doesn't know anything about it.
But because the iframe is taller than its content, it doesn't need any scrolling and thus should propagate the scroll event to the parent window.
It works as expected in this example.
But as soon as the iframe is wrapped inside a div with overflow: auto
or scroll
, it doesn't work anymore on iOS (11.3.1), as you can see in this other example.
Does anyone know how to fix this? Any help appreciated!
What I tried
overflow: hidden
on the iframe-webkit-overflow-scrolling: touch
on the iframescrolling="no"
attribute on the iframe tagpointer-events: none
on the iframe fixed the scrolling problem, but you can't interact with the iframe anymore
This title and content for this question was made by "neeh" at this link: https://stackoverflow.com/questions/50109140/ios-iframe-is-capturing-scroll-events-even-though-it-doesnt-need-to-scroll. Contributions on stackoverflow.com are made under this license.