Issue scrolling div with Safari on iPhone 6+, iPad 3 when zoomed in

人走茶凉 提交于 2019-11-30 07:39:23

问题


It seems that on iPhone 6+ and iPad 3 (devices I've tested so far which reproduce issue) there is an issue with scrolling a div when the page is zoomed in.

When first loading a page with the following basic content, the div has no problem scrolling.

Reproduction

  • Zoom page in a bit so that scale is greater than 1.0. This seems to more often than not 'disable' scrolling for the div either completely or for the most part. The page itself scrolls or 'bounces'.
  • Zoom back out to 1.0 scale and it scrolls again.

The issue can be a bit inconsistent, where sometimes when zoomed in and playing around with touching/moving/scaling the page around the scrolling will work for a bit but unreliably. Only zooming back out seems to reset it so that the div can be scrolled consistently without issue.

This does not seem to reproduce with Chrome on iPhone 6+, iPad 3, iPhone 4 (both Chrome and Safari) as well as several Android phones (Chrome).

Anyone run into this issue and/or know how to resolve? Or am I missing something?

Any information or help appreciated.

#outer {
        border: 1px solid #000;
        width: 100px;
        height: 100px;
        overflow: auto;
        /*
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        */
    }

    #inner {
        width: 100px;
        background-color: cornflowerblue;
    }

    p { margin: 0; }
<div id="outer">
        <div id="inner">
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
            <p>test</p>
        </div>
    </div>

来源:https://stackoverflow.com/questions/27387666/issue-scrolling-div-with-safari-on-iphone-6-ipad-3-when-zoomed-in

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!