Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

md-tabs: Single tab w/ stretch is not centered #1570

Closed
rgthree opened this issue Feb 19, 2015 · 1 comment
Closed

md-tabs: Single tab w/ stretch is not centered #1570

rgthree opened this issue Feb 19, 2015 · 1 comment
Assignees
Milestone

Comments

@rgthree
Copy link

rgthree commented Feb 19, 2015

<md-tabs md-stretch-tabs="always"> does not center a single-tab correctly (see that last example below, which should have the label "one" directly below the title):
dy2jkvpzwk 2
(#1506 has the scrollbar issue)

Looks like it has a width style that is correct but also a min-width that keeps it shorter. Here's a live jsbin: http://jsbin.com/guweto/2/

@mckenzielong
Copy link
Contributor

This is caused by max-width being set smaller than the stretched width of the tab.
In TabPaginationDirective, max width is calculated with this in calculateTabData:

var tabsWidth = clientWidth - PAGINATORS_WIDTH - 1;

After the style is applied there is an adjustment done for stretched tabs:

function adjustForStretchedTabs() {
     var canvasWidth = pages.length === 1 ? clientWidth : tabsWidth;
     var tabsPerPage = Math.min(Math.floor(canvasWidth / max), tabs.length);
     var tabWidth    = Math.floor((canvasWidth / tabsPerPage));
     $tabs.css('width', tabWidth + 'px');
     return calculateTabData(true);
}

Which sets the width to a value 65px larger than max-width (or PAGINATORS_WIDTH+1 px)

@ThomasBurleson ThomasBurleson modified the milestone: 0.9.0 Mar 11, 2015
robertmesserle added a commit that referenced this issue Mar 17, 2015
Closes #1850
Closes #1698
Closes #1570
Closes #1564
Closes #1518
Closes #1516
Closes #1506
Closes #1505
Closes #1403
Closes #1387
Closes #1380
Closes #1261
Closes #1247
Closes #1140
@ajoslin ajoslin added the in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs label Mar 17, 2015
robertmesserle added a commit that referenced this issue Mar 18, 2015
Closes #1850
Closes #1698
Closes #1570
Closes #1564
Closes #1518
Closes #1516
Closes #1506
Closes #1505
Closes #1403
Closes #1387
Closes #1380
Closes #1261
Closes #1247
Closes #1140
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1850
Closes #1698
Closes #1570
Closes #1564
Closes #1518
Closes #1516
Closes #1506
Closes #1505
Closes #1403
Closes #1387
Closes #1380
Closes #1261
Closes #1247
Closes #1140
Closes #1626
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1626
Closes #1698
Closes #1850
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 19, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1850
robertmesserle added a commit that referenced this issue Mar 20, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
robertmesserle added a commit that referenced this issue Mar 20, 2015
Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 24, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 24, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 25, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
robertmesserle added a commit that referenced this issue Mar 25, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
Closes #2020
robertmesserle added a commit that referenced this issue Mar 26, 2015
BREAKING CHANGE: Generated HTML structure has changed, so custom styles
will need to be updated to match the new HTML structure.

Closes #1087
Closes #1107
Closes #1140
Closes #1247
Closes #1261
Closes #1380
Closes #1387
Closes #1403
Closes #1443
Closes #1505
Closes #1506
Closes #1516
Closes #1518
Closes #1564
Closes #1570
Closes #1620
Closes #1626
Closes #1698
Closes #1777
Closes #1788
Closes #1850
Closes #1959
Closes #1986
Closes #2020
@ajoslin ajoslin removed in progress Mainly for in progress PRs, but may be used for issues that require multiple PRs resolution: fixed labels Mar 26, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants