File tree 2 files changed +41
-7
lines changed
2 files changed +41
-7
lines changed Original file line number Diff line number Diff line change 44
44
45
45
position : relative ;
46
46
overflow-x : auto ;
47
- overflow-y : hidden ;
48
- height : 48px ;
47
+ overflow-y : hidden ;
49
48
width : 100% ;
50
49
background-color : var (--md-sys-color-surface );
51
50
margin : 0 auto ;
56
55
list-style-type : none ;
57
56
display : inline-block ;
58
57
text-align : center ;
59
- line-height : 48px ;
60
- height : 48px ;
58
+ line-height : 48px ;
61
59
padding : 0 ;
62
60
margin : 0 ;
63
61
62
+ i .material-icons {
63
+ position : relative ;
64
+ top : 8px ;
65
+ vertical-align : middle ;
66
+ }
67
+
68
+ span {
69
+ height : 24px ;
70
+ line-height : 20px ;
71
+ }
72
+
64
73
a {
65
74
& .active {
66
75
background-color : transparent ;
83
92
}
84
93
85
94
color : var (--md-sys-color-on-surface-variant );
86
- display : block ;
95
+ display : flex ;
96
+ flex-direction : column ;
87
97
width : 100% ;
88
98
height : 100% ;
99
+ min-height : 48px ; // needed for only-icons tabs
89
100
padding : 0 24px ;
90
101
font-size : 14px ;
91
102
text-overflow : ellipsis ;
112
123
will-change : left , right ;
113
124
border-radius : 3px 3px 0 0 ;
114
125
}
126
+
127
+ & .tabs-horizontal .tab {
128
+ height : 48px ;
129
+
130
+ a {
131
+ display : block ;
132
+ }
133
+
134
+ i .material-icons {
135
+ padding : 0 4px ;
136
+ position : relative ;
137
+ top : -2px ;
138
+ vertical-align : middle ;
139
+ }
140
+ }
115
141
}
116
142
117
143
/* Fixed Sidenav hide on smaller */
Original file line number Diff line number Diff line change @@ -131,8 +131,16 @@ export class Tabs extends Component<TabsOptions> {
131
131
}
132
132
133
133
_handleTabClick = ( e : MouseEvent ) => {
134
- const tabLink = e . target as HTMLAnchorElement ;
135
- const tab = tabLink . parentElement ;
134
+ let tabLink = e . target as HTMLAnchorElement ;
135
+
136
+ if ( ! tabLink )
137
+ return ;
138
+ var tab = tabLink . parentElement ;
139
+ while ( tab && ! tab . classList . contains ( 'tab' ) ) {
140
+ tabLink = tabLink . parentElement as HTMLAnchorElement ;
141
+ tab = tab . parentElement ;
142
+ }
143
+
136
144
// Handle click on tab link only
137
145
if ( ! tabLink || ! tab . classList . contains ( 'tab' ) ) return ;
138
146
// is disabled?
You can’t perform that action at this time.
0 commit comments