materialize icon indicating copy to clipboard operation
materialize copied to clipboard

about tabs adjust to small resolution ratio(320px) the header scroll bar

Open UniqueCrownClown opened this issue 10 years ago • 3 comments

About components Tabs,in 320px screen,the header scroll bar appear,feels it is not nice,how to full of the screen

UniqueCrownClown avatar Jan 11 '16 02:01 UniqueCrownClown

I've noticed this too. Not just on 320px screen but as I grow or shrink the window I noticed a horizontal scrollbar flicker on the tab headers. See screenshot below.

Browser screen shot 2016-01-22 at 11 32 46 am

Element screen shot 2016-01-22 at 11 33 08 am

When Resizing the window a little scroll goes away

Browser screen shot 2016-01-22 at 11 33 27 am

Element screen shot 2016-01-22 at 11 33 35 am

2 work-arounds.

To never show scroll bar on tabs add the following in _tabs.scss from

.tabs {
    ...
    overflow: hidden;
}

or update the following lines in the tabs.js file

// Line 41
$indicator.css({"right": $tabs_width - (($index + 1) * $tab_width)});
// Line 51
$indicator.css({"right": $tabs_width - (($index + 1) * $tab_width)});
// Line 95
$indicator.velocity({"right": $tabs_width - (($index + 1) * $tab_width)}, { duration: 300, queue: false, easing: 'easeOutQuad'});
// Line 101
$indicator.velocity({"right": $tabs_width - (($index + 1) * $tab_width)}, { duration: 300, queue: false, easing: 'easeOutQuad'});

to

// Line 41
$indicator.css({"right": Math.max(0, $tabs_width - (($index + 1) * $tab_width))});
// Line 51
$indicator.css({"right": Math.max(0, $tabs_width - (($index + 1) * $tab_width))});
// Line 95
$indicator.velocity({"right": Math.max(0, $tabs_width - (($index + 1) * $tab_width))}, { duration: 300, queue: false, easing: 'easeOutQuad'});
// Line 101
$indicator.velocity({"right": Math.max(0, $tabs_width - (($index + 1) * $tab_width))}, {duration: 300, queue: false, easing: 'easeOutQuad', delay: 90});

This always will confine the indicator within the container never having a negative value

Frzy avatar Jan 22 '16 18:01 Frzy

Fixed in 4f18709

acburst avatar Mar 18 '16 01:03 acburst

Still having this issue with v0.97.8 ...

DavidUnzue avatar Jan 18 '17 12:01 DavidUnzue