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.

Tabbed Menu overflow issue

See original GitHub issue

When using the tabbed menu, there are times when a horizontal scroll bar appears when there shouldn’t.

See CodePen: http://codepen.io/anon/pen/gPgmpY. Click on the 3rd tab and make the page 917px wide. The indicator style that gets applied is <div class="indicator" style="right: -1px; left: 588px;"></div>

Changing the -1px to 0px solves the problem…possible solution to check for less then 0 and then set to 0. This is a quick hack job, but it works to alleviate the issue. The page load also needs to be fixed as well.

  // append indicator then set indicator width to tab width
      $this.append('<div class="indicator"></div>');
      var $indicator = $this.find('.indicator');

      if ($this.is(":visible")) {
        var right = $tabs_width - (($index + 1) * $tab_width);
        var left = $index * $tab_width
        if(right < 0) {right = 0};

        $indicator.css({"right": right});
        $indicator.css({"left": left});
      }
      $(window).resize(function () {
        var right = $tabs_width - (($index + 1) * $tab_width);
        var left = $index * $tab_width
        if(right < 0) {right = 0};

        $tabs_width = $this.width();
        $tab_width = $this.find('li').first().outerWidth();
        if ($index < 0) {
          $index = 0;
        }
        if ($tab_width !== 0 && $tabs_width !== 0) {
           $indicator.css({"right": right});
           $indicator.css({"left": left});
        }
      });

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

9reactions
lostliviocommented, Jan 5, 2016

For those needing a quick fix , a friend of mine suggested you can override the tab style. .tabs { overflow-x: hidden; }

Also, a better solution to the above is to add a Math.min(0, expression) to each of the checks

3reactions
acburstcommented, Mar 18, 2016

Fixed in 4f18709

Read more comments on GitHub >

github_iconTop Results From Across the Web

319777 - When a tab in the overflow menu is active, highlight ...
With overflow menus, you can see all the tabs you have open (in one direction) in a single click, rather than having to...
Read more >
iOS 15 overflow issue for fixed elements when Tab Bar is ...
I block everything except the "burger menu" (side menu) from scrolling after that menu is opened. When the menu is closed, all scroll...
Read more >
How can I prevent the overflow tab menu from bugging out ...
When I open too many tabs the "tab overflow menu" renders in and out when I move the mouse. Seems that there is...
Read more >
Bootstrap 4 tabs overflow to dropdown on Codeply
Using a little jQuery, we can automatically collapse the extra menu items into a dropdown menu on the right. When there are no...
Read more >
Overflow Tab Navigation - CodePen
Insecure Resource. The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https....
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