question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tabs tab indicator missing on load

See original GitHub issue

I’m having issues with the tabs, the tab indicator is missing when the tabs are loaded, The first tab is the default and the tab text is colored as selected tab and displaying the correct content but the indicator is missing. There’s only 2 ways to get the indicator to show:

  1. When I start clicking on the tabs the indicator appears and then stays working correctly
  2. When the tabs load and I re-size the window the indicator appears

this is what I have:

<div class="container">         
  <div class="row">
    <div id="rmt-rooms" class="col s12 m3">
     Some stuff
    </div>      

    <!-- tabs -->
    <div id="rmt-dialog" class="col s12 m9">
      <div class="card-panel">
        <div class="row">
          <div class="col s12">
            <ul class="tabs">
              <li class="tab"><a href="#roomType" class="active">Room Type</a></li>
              <li class="tab"><a href="#roomPhotos">Room Photos</a></li>        
              <li class="tab"><a href="#roomNumbers">Room Numbers</a></li>
            </ul>
          </div>
          <div id="roomType" class="col s12"></div>
          <div id="roomPhotos" class="col s12"></div>
          <div id="roomNumbers" class="col s12"></div>
        </div>                      
      </div>                        
    </div>  
    <!--End  tabs -->                       
  </div>
</div>

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14

github_iconTop GitHub Comments

10reactions
adamhammondcommented, Jul 21, 2016

@julianctni for a quick fix, you could:

At the end of your event handler for $(document).ready, add the following: window.dispatchEvent(new Event('resize'));

4reactions
makindemayowacommented, Feb 12, 2018

This worked for me.
$(document).ready(function(){ $('ul.tabs').tabs(); });

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Material Tabs indicator not showing on first load
When I first load a page / navigate to one of the tab routes, the correct tab is selected, but the indicator is...
Read more >
React Material Tabs indicator not showing on first load-Reactjs
My solution based on above ones but a bit different. The difference is that I update the indicator via a deferred call (...
Read more >
Tabs - Angular Material
Angular Material tabs organize content into separate views where only one view can be visible at a time. Each tab's label is shown...
Read more >
Material Top Tabs Navigator | React Navigation
A material-design themed tab bar on the top of the screen that lets you switch between different routes by tapping the tabs or...
Read more >
TabLayout | Android Developers
Indicator animation mode used to translate the selected tab indicator between two tabs using a linear motion. int, INDICATOR_GRAVITY_BOTTOM.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found