11

I'm developing a webapp and I've got a div inside of an iFrame that has hidden, overflowed content that I want to be scrollable.

On Safar on iOS 9 when I add -webkit-overflow-scrolling:touch; to the div (that already has overflow-y: scroll; to give the scroll a fluid feel, it breaks and doesn't scroll at all.

I know that this is a known issue but I haven't found solutions relevant to my scenario: I have iFrames that do more than transmit data, they actually contain content for the user. Orientation doesn't matter, the content will always need to be scrollable.

4
  • Have you tired specifying overflow-y in the body tag like this body {overflow-y: scroll;} that might work as it will applied through out the site instead of just on a single div Commented Oct 1, 2015 at 23:57
  • @BrentWhite no, that doesn't solve the issue Commented Oct 2, 2015 at 21:02
  • Were you able to solve this yet? Post a fiddle up so I can see the issue. Commented Oct 4, 2015 at 1:09
  • @BrentWhite it's hard for me to show a fiddle as this is a big nest of iframes Commented Oct 10, 2015 at 0:36

3 Answers 3

17

I just ran into this issue with dynamic content within a div that had overflow: auto and -webkit-overflow-scrolling: touch.

Dirty, ugly workaround: force the content inside to be bigger than the scrolling div when added to dom. Something like this:

<div style="overflow: auto; -webkit-overflow-scrolling: touch;">
    <div style="min-height: 101%">
        dynamic content
    </div>
</div>

My theory is that Safari tries (needs) to do some heavy optimizations when -webkit-overflow-scrolling: touch is added, and these don't play nice with some types of dynamic content.

Sign up to request clarification or add additional context in comments.

1 Comment

In 2019: I still run into the same issue. Is there any progress for fixing this in safari or an alternative solution approach?
1

I also ran into this issue with webkit-overflow-scrolling: touch on iOS9. It can be reproduced on an device or the iOS simulator. As Christopher Camps mentions, it only happens with dynamic content, i.e. content that changes from being smaller then the scrollable container to larger then the container.

Heres a CodePen demonstrating this issue, including Christopher Camps fix.

Comments

0

It seems another hack for this Safari bug is to use javascript to set a style="overflow: none" and reset it back to its previous value immediately after.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.