File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ function TabsContainer({
161
161
162
162
type TabsSnapshot = Record <
163
163
string ,
164
- { left : number ; active : boolean }
164
+ { left : number ; active : boolean ; width : number }
165
165
>
166
166
type Snapshot = {
167
167
titleBarHeight : number
Original file line number Diff line number Diff line change @@ -110,12 +110,16 @@ function getPanelTabs(
110
110
const dx = prev
111
111
? prev . left + ( next . left - prev . left ) * t
112
112
: next . left
113
+ const width = prev
114
+ ? prev . width + ( next . width - prev . width ) * t
115
+ : next . width
113
116
return {
114
117
active : filename === active ,
115
118
title : filename ,
116
119
style : {
117
120
position : "absolute" as const ,
118
121
transform : `translateX(${ dx } px)` ,
122
+ width,
119
123
} ,
120
124
}
121
125
} )
@@ -139,6 +143,7 @@ function getPanelTabs(
139
143
position : "absolute" as const ,
140
144
transform : `translateX(${ next . left } px)` ,
141
145
opacity : t ,
146
+ width : next . width ,
142
147
} ,
143
148
}
144
149
} )
@@ -179,6 +184,7 @@ function getPanelTabs(
179
184
position : "absolute" as const ,
180
185
opacity : 1 - t ,
181
186
transform : `translateX(${ prev . left } px)` ,
187
+ width : prev . width ,
182
188
} ,
183
189
}
184
190
} )
Original file line number Diff line number Diff line change @@ -131,8 +131,10 @@ function getTabsDimensions(
131
131
const dimensions = { } as TabsSnapshot
132
132
tabElements . forEach ( child => {
133
133
const filename = child . getAttribute ( "title" ) !
134
+ const rect = child . getBoundingClientRect ( )
134
135
dimensions [ filename ] = {
135
- left : child . getBoundingClientRect ( ) . left - parentLeft ,
136
+ left : rect . left - parentLeft ,
137
+ width : rect . width ,
136
138
active : filename === active ,
137
139
}
138
140
} )
You can’t perform that action at this time.
0 commit comments