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

Commit 7d0a282

Browse files
committed
fix(tabs): use position: absolute container to fix ios bugs
Closes #220.
1 parent 7fdeae5 commit 7d0a282

2 files changed

Lines changed: 21 additions & 15 deletions

File tree

src/components/tabs/_tabs.scss

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ material-tabs {
88

99
.tabs-header {
1010
width: 100%;
11+
height: $tabs-header-height;
1112
@include box-sizing(border-box);
12-
@include flex-display();
1313
position: relative;
1414
background-color: #4285F4;
1515
}
@@ -23,6 +23,14 @@ material-tabs {
2323
width: $tabs-paginator-width;
2424
min-height: 100%;
2525

26+
position: absolute;
27+
&.prev {
28+
left: 0;
29+
}
30+
&.next {
31+
right: 0;
32+
}
33+
2634
/* TODO Once we have a better way to inline svg images, change this
2735
to use svgs correctly */
2836
&.active.prev {
@@ -42,12 +50,18 @@ material-tabs {
4250
material-tabs[center] .tabs-header:not(.tab-paginating) .tabs-header-items {
4351
@include flex-justify-content(center);
4452
}
53+
.tab-paginating .tabs-header-items-container {
54+
left: $tabs-paginator-width;
55+
right: $tabs-paginator-width;
56+
}
4557
.tabs-header-items-container {
4658
overflow: hidden;
47-
position: relative;
48-
width: 100%;
59+
position: absolute;
60+
left: 0;
61+
right: 0;
62+
height: 100%;
4963
white-space: nowrap;
50-
font-size: 14px;
64+
font-size: 16px;
5165
font-weight: 500;
5266
text-transform: uppercase;
5367
margin: auto;
@@ -59,6 +73,7 @@ material-tabs[center] .tabs-header:not(.tab-paginating) .tabs-header-items {
5973
transition: transform 0.2s linear;
6074
@include transform(translate3d(0,0,0));
6175
width: 100%;
76+
height: 100%;
6277
}
6378
}
6479

@@ -79,9 +94,6 @@ material-ink-bar {
7994
}
8095
}
8196

82-
83-
84-
8597
material-tab {
8698
@include flex(1);
8799
@include flex-display();
@@ -91,7 +103,7 @@ material-tab {
91103
position: relative;
92104
z-index: 0;
93105
overflow: hidden;
94-
line-height: 40px;
106+
height: 100%;
95107
text-align: center;
96108
cursor: pointer;
97109
min-width: $tabs-tab-width;
@@ -132,10 +144,3 @@ material-tab {
132144
shadow {
133145
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
134146
}
135-
136-
137-
138-
139-
140-
141-

src/theme/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ $card-box-shadow: $whiteframe-shadow-z1;
116116
// Tabs
117117
$tabs-paginator-width: $baseline-grid * 4 !default;
118118
$tabs-tab-width: $baseline-grid * 12 !default;
119+
$tabs-header-height: 48px;
119120

120121
// Forms and inputs
121122

0 commit comments

Comments
 (0)