Flex Navbar doesn't display in Safari but works in Chrome

Viewed 197

I have a bottom navbar and am encountering a very strange issue. It works perfectly in Chrome (Android) but in Safari (iOS) it doesn't.

The even stranger issue seems to be that "onclick" events work on the navbar, so it definitely seems to be there, it just isn't visible.

I've been at this for hours and can't figure it out. Anyone have any ideas what could be wrong?

.mobile-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  will-change: transform !important;
  transform: translateZ(0) !important;
  display: flex !important;
  height: 60px !important;
  background-color: #fff !important;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-bottom-nav__item {
  flex-grow: 1 !important;
  text-align: center !important;
  font-size: 0.8rem !important;
  display: block !important;
  flex-direction: column !important;
  justify-content: center !important;
  font-weight: 600;
  height: 60px !important;
}

.mobile-bottom-nav__item--active {
  color: #FF0030;
}

.mobile-bottom-nav__item-content {
  display: flex;
  flex-direction: column;
  margin-top: 5px;
  z-index: 1001 !important;
}
<nav class="mobile-bottom-nav">
  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content mobile-bottom-nav__item--active">
      Section 1
    </div>
  </div>

  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content">
      Section 2
    </div>
  </div>

  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content">
      Section 3
    </div>
  </div>
</nav>

As you can see, I tried adding z-index but that also didn't work.

UPDATE It seems removing these 2 lines made it show up:

will-change:transform !important;
transform: translateZ(0) !important;
1 Answers

Almost all modern desktop and mobile browsers support CSS flexbox! You can checkout flexbox cross-browser support and flexbugs details here.

.mobile-bottom-nav {
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 1000 !important;
  will-change: transform !important;
  transform: translateZ(0) !important;
  display: -webkit-flex !important;
  display: flex !important;
  height: 60px !important;
  background-color: #fff !important;
  max-width: 600px;
  margin: 0 auto;
}

.mobile-bottom-nav__item {
  flex-grow: 1 !important;
  -webkit-flex-grow: 1 !important;
  text-align: center !important;
  font-size: 0.8rem !important;
  display: block !important;
  flex-direction: column !important;
  -webkit-flex-direction: column !important;
  justify-content: center !important;
  -webkit-justify-content: center !important;
  font-weight: 600;
  height: 60px !important;
}

.mobile-bottom-nav__item--active {
  color: #FF0030;
}

.mobile-bottom-nav__item-content {
  display: -webkit-flex !important;
  display: flex !important;
  -webkit-flex-direction: column;
  margin-top: 5px;
  z-index: 1001 !important;
}
<nav class="mobile-bottom-nav">
  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content mobile-bottom-nav__item--active">
      Section 1
    </div>
  </div>

  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content">
      Section 2
    </div>
  </div>

  <div class="mobile-bottom-nav__item" onclick="">
    <div class="mobile-bottom-nav__item-content">
      Section 3
    </div>
  </div>
</nav>

Related