Tabs tab indicator missing on load
See original GitHub issueI’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:
- When I start clicking on the tabs the indicator appears and then stays working correctly
- 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:
- Created 8 years ago
- Comments:14
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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'));
This worked for me.
$(document).ready(function(){ $('ul.tabs').tabs(); });