File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -220,6 +220,18 @@ function TabBar({
220
220
} ;
221
221
}
222
222
223
+ function onWheel ( event : React . WheelEvent < HTMLDivElement > ) {
224
+ if ( ! event . shiftKey ) {
225
+ event . currentTarget . scrollLeft += event . deltaY ;
226
+ } else {
227
+ const nextTabId = selected + ( event . deltaY > 0 ? 1 : - 1 ) ;
228
+ if ( nextTabId < 0 || nextTabId >= widgets . length ) return ;
229
+ const widgetId = ( widgets [ nextTabId ] as any ) ?. props ?. id ;
230
+ if ( widgetId === undefined ) return ;
231
+ onTabClick ( nextTabId , widgetId ) ;
232
+ }
233
+ }
234
+
223
235
return (
224
236
< Droppable droppableId = { windowId } type = "dockable-tab" direction = "horizontal" >
225
237
{ ( provided , snapshot ) => (
@@ -236,6 +248,7 @@ function TabBar({
236
248
< div
237
249
ref = { provided . innerRef }
238
250
className = { css . tabSpacer }
251
+ onWheel = { onWheel }
239
252
{ ...provided . droppableProps }
240
253
>
241
254
{ widgets . map ( ( child : any , i ) => {
Original file line number Diff line number Diff line change 171
171
}
172
172
173
173
.tabSpacer {
174
- display : flex;
175
- flex-grow : 1 ;
176
- flex-shrink : 1 ;
177
- width : 0 ;
174
+ display : flex;
175
+ flex-grow : 1 ;
176
+ flex-shrink : 1 ;
177
+ width : 0 ;
178
+ overflow-x : scroll;
179
+ overflow-y : hidden;
180
+ scrollbar-width : none;
181
+ }
182
+
183
+ .tabSpacer ::-webkit-scrollbar {
184
+ height : 0px ;
178
185
}
179
186
180
187
.dropBorder {
You can’t perform that action at this time.
0 commit comments