Vertical scroll not working on Mobile Safari

2019-06-07 20:25发布

问题:

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.