Topic: navbars grows height automatically on page refresh

ioCare Research Team free asked 3 years ago


Expected behavior

The navbar should remain of the same size after page first time load or reload

Actual behavior

This is the simple code used for the navbar. There is a footer code from the sample below it. nothing else. What is happening in the width of the navbar changes and becomes big when the page is reloaded multiple times. It generally happens when the page is loaded first time sometime. If the page is resized, the navbar size resets to the original. But if again refreshed for 2 or 3 times then the navbar grows in size. It's like a toggle, every time to u refresh the page the size of the navbar changes. Please help!

Resources (screenshots, code snippets etc.)

This is simple code I am using

<header>
  <!--Navbar-->
  <mdb-navbar SideClass="navbar navbar-expand-lg navbar-dark indigo">

    <!-- Navbar brand -->
    <mdb-navbar-brand><a class="navbar-brand" href="#">Navbar</a></mdb-navbar-brand>

    <!-- Collapsible content -->
    <links>

      <!-- Links -->
      <ul class="navbar-nav mr-auto">
        <li class="nav-item active">
          <a class="nav-link waves-light" mdbWavesEffect>Home<span class="sr-only">(current)</span></a>
        </li>
        <li class="nav-item">
          <a class="nav-link waves-light" mdbWavesEffect>Features</a>
        </li>
        <li class="nav-item">
          <a class="nav-link waves-light" mdbWavesEffect>Pricing</a>
        </li>

        <!-- Dropdown -->
        <li class="nav-item dropdown" dropdown>
          <a dropdownToggle mdbWavesEffect type="button" class="nav-link dropdown-toggle waves-light" mdbWavesEffect>
            Basic dropdown<span class="caret"></span></a>
          <div *dropdownMenu class="dropdown-menu dropdown dropdown-primary" role="menu">
            <a class="dropdown-item waves-light" mdbWavesEffect href="#">Action</a>
            <a class="dropdown-item waves-light" mdbWavesEffect href="#">Another action</a>
            <a class="dropdown-item waves-light" mdbWavesEffect href="#">Something else here</a>
            <div class="divider dropdown-divider"></div>
            <a class="dropdown-item waves-light" mdbWavesEffect href="#">Separated link</a>
          </div>
        </li>

      </ul>
      <!-- Links -->

      <!-- Search form -->
      <form class="form-inline waves-light" mdbWavesEffect>
        <div class="md-form my-0">
          <input class="form-control mr-sm-2" type="text" placeholder="Search">
        </div>
      </form>
    </links>
    <!-- Collapsible content -->

  </mdb-navbar>
  <!--/.Navbar-->

</header>

<button type="button" mdbBtn color="primary" gradient="purple" mdbWavesEffect>Test</button>

<button mdbBtn type="button" gradient="peach" size="lg" mdbWavesEffect>Large Button</button>


<router-outlet></router-outlet>


<!-- Footer -->
<footer class=" text-center " style="background-color:#0bb1da;">
  <!-- Grid container -->
  <div class="container p-4">

    <!-- Section: Social media -->
    <section class="mb-4">
      <!-- Facebook -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #3b5998" href="#!" role="button"><i class="fab fa-facebook-f"></i></a>

      <!-- Twitter -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #55acee" href="#!" role="button"><i class="fab fa-twitter"></i></a>

      <!-- Google -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #dd4b39" href="#!" role="button"><i class="fab fa-google"></i></a>

      <!-- Instagram -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #ac2bac" href="#!" role="button"><i class="fab fa-instagram"></i></a>

      <!-- Linkedin -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #0082ca" href="#!" role="button"><i class="fab fa-linkedin-in"></i></a>
      <!-- Github -->
      <a class="btn btn-primary btn-floating m-1" style="background-color: #333333" href="#!" role="button"><i class="fab fa-github"></i></a>
    </section>
    <!-- Section: Social media -->



    <!-- Section: Text -->
    <section class="mb-4">
      <p>
        Lorem ipsum dolor sit amet consectetur adipisicing elit. Sunt
        distinctio earum repellat quaerat voluptatibus placeat nam,
        commodi optio pariatur est quia magnam eum harum corrupti dicta,
        aliquam sequi voluptate quas.
      </p>
    </section>
    <!-- Section: Text -->


    <!-- Section: Links -->
    <section class="">
      <!--Grid row-->
      <div class="row">
        <!--Grid column-->
        <div class="col-lg-3 col-md-6 mb-4 mb-md-0">
          <h5 class="text-uppercase">Links</h5>

          <ul class="list-unstyled mb-0">
            <li>
              <a href="#!" class="text-dark">Link 1</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 2</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 3</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 4</a>
            </li>
          </ul>
        </div>
        <!--Grid column-->

        <!--Grid column-->
        <div class="col-lg-3 col-md-6 mb-4 mb-md-0">
          <h5 class="text-uppercase">Links</h5>

          <ul class="list-unstyled mb-0">
            <li>
              <a href="#!" class="text-dark">Link 1</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 2</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 3</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 4</a>
            </li>
          </ul>
        </div>
        <!--Grid column-->

        <!--Grid column-->
        <div class="col-lg-3 col-md-6 mb-4 mb-md-0">
          <h5 class="text-uppercase">Links</h5>

          <ul class="list-unstyled mb-0">
            <li>
              <a href="#!" class="text-dark">Link 1</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 2</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 3</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 4</a>
            </li>
          </ul>
        </div>
        <!--Grid column-->

        <!--Grid column-->
        <div class="col-lg-3 col-md-6 mb-4 mb-md-0">
          <h5 class="text-uppercase">Links</h5>

          <ul class="list-unstyled mb-0">
            <li>
              <a href="#!" class="text-dark">Link 1</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 2</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 3</a>
            </li>
            <li>
              <a href="#!" class="text-dark">Link 4</a>
            </li>
          </ul>
        </div>
        <!--Grid column-->
      </div>
      <!--Grid row-->
    </section>
    <!-- Section: Links -->

  </div>
  <!-- Grid container -->

  <!-- Copyright -->
  <div class="text-center p-3" style="background-color: rgba(0, 0, 0, 0.2)">
    © 2021 Copyright:
    <a class="text-dark" href="https://app.iocare.in">ioCare, Pune</a>
  </div>
  <!-- Copyright -->

</footer>
<!-- Footer -->

Arkadiusz Idzikowski staff commented 3 years ago

@ioCare Research Team Could you please add a screenshot showing this unexpected behavior?

Do you use any custom styles for navbar or html/body elements?


ioCare Research Team free commented 3 years ago

Hi, find here the screenshot link. https://ibb.co/tb1SP8J

or you can also visit the live website from Google Chrome: https://arnoldcentralschool.org/ Most probably you will see the oversized navbar on the first load. It can be restored just by resizing the window. But you can reproduce it by just reloading the page multiple times.

There is no custom CSS or anything used. I have even tried reproducing this with the first clean install of mdbootstrap angular along with navbar and footer. but the issue is the same.


Arkadiusz Idzikowski staff commented 3 years ago

Thank you, we will try to reproduce that on our end and let you know what we found.



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 10.1.1
  • Device: PC
  • Browser: Google Chrome Latest
  • OS: Windows
  • Provided sample code: No
  • Provided link: No