Tabbed Menu overflow issue
See original GitHub issueWhen 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:
- Created 8 years ago
- Reactions:1
- Comments:11
Top 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 >
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
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
Fixed in 4f18709