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 in wrong position, even after using updateTabIndicator()

See original GitHub issue

The button is clicked programmatically using select() on loading, just after initialisation. The selection is correct but the indicator is off. If I then use updateTabIndicator(), the indicator moves but not to the right place, as it would if the tab was click.

Here’s the indicator on loading on loading

Here it is once updateTabIndicator() is called image

https://gfycat.com/HollowFailingAntelopegroundsquirrel

  • Version used: 1.0.0-beta
  • Browser Name and version: Google Chrome | 65.0.3325.181 (Official Build) (64-bit) (cohort: Stable)
  • Operating System: Windows 10

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
aleksandra-grushkocommented, Aug 8, 2019

this is my solution:

jQuery(document).ready(function(){
	jQuery('.tabs').tabs();
});
window.addEventListener('orientationchange', function() {
  setTimeout(function(){
  	jQuery('.tabs').tabs('updateTabIndicator');
  },10)
});
0reactions
rpalacio86commented, Dec 26, 2022

I solved this problem hiding the indicator and styling the active tab with a bottom border instead:

/* CSS */
.tabs .indicator {
   display: none;
}

.tab a.active {
    border-bottom: 2px solid;
    border-color:  #f6b2b5;
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Materialize CSS Tabs Indicator Behavior Within Container
I'm working on an item where I will be displaying a set of related tables set inside tabs. See the fiddle here.
Read more >
Tabs - Materialize
Recalculate tab indicator position. This is useful when the indicator position is not correct. instance.updateTabIndicator(); ...
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