Vertical scroll not working on Mobile Safari

◇◆丶佛笑我妖孽 提交于 2020-01-02 16:34:33

问题


For some reason, vertical scroll is not working on my website when I access it on mobile Safari (iOS 9.1, iPhone 5, Safari 8.1):

https://sleepy-anchorage-3222.herokuapp.com

The mobile Safari debug results are attached.The only relevant errors I see are 5 CSS, font-awesome related warnings, everything else is normal.

Vertical scroll works fine on iPhone 6, and also its fine on my desktop browser. What's going on here??

(Note: I'm using Font Awesome icons and FlexBox layout, not sure if either are related to the problem though).

MOBILE SAFARI DEBUG CONSOLE

RELEVANT SCSS CODE

@media (max-width:960px){
   > aside {
     flex: 0 0 100%;
     display: flex;
     flex-flow: column nowrap;
     height: 100%;

      > header {
        flex: 0 0 60px;
        margin: 0 0px;
      }

      > main {
        flex: 1 auto;
        height: 100%;
        overflow-y: scroll;
        padding: 0 10px;
      }

.restaurant {
  margin: 30px 0;

  &.selected {
    box-shadow: 0 0 5px 3px rgba(0,0,0,0.5);;
    padding: 2px;
  }

  .item-image {
    max-width: 100%;
  }

  }

  figcaption {
    min-height: 80px;
    position: relative;
  }

  .item-rating {
    display: inline-block;
    position: absolute;
  }

回答1:


Added this to body tag:

-webkit-overflow-scrolling: touch;

and it now works.



来源:https://stackoverflow.com/questions/33441111/vertical-scroll-not-working-on-mobile-safari

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