Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fixed header disapearing on ios safari bounce

Current results:

enter image description here

Expected results:

enter image description here

You can see an actual example here if you have an iOS device: client.wildfyre.net

How can I fix this?

Code:

    #topNav {
      height: 50px;
      margin: 0 auto;
      background-color: #263238;
      color: white;
      position: fixed;
      top: 0px;
      left: 0px;
      width: 100%;
      z-index: 5;
    }

    #topNavMenu {
      position: fixed;
      right: -20px;
      top: 7px;
    }
like image 610
Cameron Gilbert Avatar asked May 12 '18 15:05

Cameron Gilbert


1 Answers

First of all, you should understand what is causing the problem.

enter image description here

If you remove the 'mat-drawer-content' class and the transition inline styles, then you will get rid of the scrolling effect.

Now, if you want the scrolling effect and don't want to see this issue, then we have 2 solutions:

  1. Remove <nav> as a child of 'mat-drawer-content' div and add as a sibling, so that the transition effect is not applied on the <nav> tag.

or

  1. Add an overflow: hidden property on the 'mat-drawer-content'. enter image description here

I tried both of them on the real device and it works. Attached Screenshot from iphoneX. enter image description here

like image 60
Rahul Gandhi Avatar answered Sep 21 '22 07:09

Rahul Gandhi