@@ -137,6 +137,34 @@ const data = [
137
137
{ a : '1333' , c : 'eee' , d : 2 , key : '20' } ,
138
138
] ;
139
139
140
+ const columns3 : ColumnType < RecordType > [ ] = [
141
+ { title : '' , dataIndex : 'name' , key : '0' } ,
142
+ { title : 'First column' , dataIndex : 'name' , key : '1' } ,
143
+ { title : 'Second column' , dataIndex : 'address' , key : '2' } ,
144
+ { title : 'Third column' , dataIndex : 'age' , key : '3' } ,
145
+ { title : 'Another column' , dataIndex : 'address' , key : '4' } ,
146
+ { title : 'Extra column' , dataIndex : 'name' , key : '5' } ,
147
+ { title : 'And yet another column' , dataIndex : 'address' , key : '6' } ,
148
+ {
149
+ title : 'Column 7 with extraaaaaaaaa long word' ,
150
+ dataIndex : 'age' ,
151
+ key : '7' ,
152
+ } ,
153
+ { title : 'Column 8' , dataIndex : 'address' , key : '8' } ,
154
+ { title : 'Column 9' , dataIndex : 'name' , key : '9' } ,
155
+ { title : 'Column 10' , dataIndex : 'address' , key : '10' } ,
156
+ { title : 'Column 11' , dataIndex : 'address' , key : '11' } ,
157
+ { title : 'Column 12' , dataIndex : 'age' , key : '12' } ,
158
+ { title : 'Column 13' , dataIndex : 'address' , key : '13' } ,
159
+ { title : 'Column 14' , dataIndex : 'name' , key : '14' } ,
160
+ { title : 'Column 15' , dataIndex : 'address' , key : '15' } ,
161
+ { title : 'Column 16' , dataIndex : 'address' , key : '16' } ,
162
+ { title : 'Column 17' , dataIndex : 'name' , key : '17' } ,
163
+ { title : 'Column 18' , dataIndex : 'address' , key : '18' } ,
164
+ { title : 'Column 19' , dataIndex : 'address' , key : '19' } ,
165
+ { title : 'Column 20' , dataIndex : 'age' , key : '20' } ,
166
+ ] ;
167
+
140
168
const Demo = ( ) => {
141
169
const container = useRef ( ) ;
142
170
return (
@@ -274,7 +302,7 @@ const Demo = () => {
274
302
< br />
275
303
< Table
276
304
columns = { fixedColumns }
277
- data = { [ { } ] }
305
+ data = { [ { key : '1' } ] }
278
306
scroll = { {
279
307
x : 'max-content' ,
280
308
} }
@@ -283,7 +311,7 @@ const Demo = () => {
283
311
< br />
284
312
< Table
285
313
columns = { columnsWithWidth }
286
- data = { [ { } ] }
314
+ data = { [ { key : '1' } ] }
287
315
scroll = { {
288
316
x : 1200 ,
289
317
} }
@@ -301,7 +329,7 @@ const Demo = () => {
301
329
< br />
302
330
< Table
303
331
columns = { fixedColumns . map ( column => ( { ...column , width : undefined } ) ) }
304
- data = { [ { } ] }
332
+ data = { [ { key : '1' } ] }
305
333
scroll = { {
306
334
x : 'max-content' ,
307
335
} }
@@ -310,12 +338,26 @@ const Demo = () => {
310
338
< br />
311
339
< Table
312
340
columns = { columnsGrouped }
313
- data = { [ { } , { } ] }
341
+ data = { [ { key : '1' } , { key : '2' } ] }
314
342
scroll = { {
315
343
x : 'max-content' ,
316
344
} }
317
345
sticky
318
346
/>
347
+ < br />
348
+ < h3 > scroll.x is true</ h3 >
349
+ < p > https://github.com/ant-design/ant-design/issues/54894</ p >
350
+ < Table
351
+ columns = { columns3 }
352
+ data = {
353
+ [
354
+ { key : '1' , name : 'Test' , age : 1 , address : '2' } ,
355
+ { key : '2' , name : '0' , age : 1 , address : '2' } ,
356
+ ] as any
357
+ }
358
+ sticky
359
+ scroll = { { x : true } }
360
+ />
319
361
</ div >
320
362
) ;
321
363
} ;
0 commit comments