@@ -137,6 +137,34 @@ const data = [
137137 { a : '1333' , c : 'eee' , d : 2 , key : '20' } ,
138138] ;
139139
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+
140168const Demo = ( ) => {
141169 const container = useRef ( ) ;
142170 return (
@@ -274,7 +302,7 @@ const Demo = () => {
274302 < br />
275303 < Table
276304 columns = { fixedColumns }
277- data = { [ { } ] }
305+ data = { [ { key : '1' } ] }
278306 scroll = { {
279307 x : 'max-content' ,
280308 } }
@@ -283,7 +311,7 @@ const Demo = () => {
283311 < br />
284312 < Table
285313 columns = { columnsWithWidth }
286- data = { [ { } ] }
314+ data = { [ { key : '1' } ] }
287315 scroll = { {
288316 x : 1200 ,
289317 } }
@@ -301,7 +329,7 @@ const Demo = () => {
301329 < br />
302330 < Table
303331 columns = { fixedColumns . map ( column => ( { ...column , width : undefined } ) ) }
304- data = { [ { } ] }
332+ data = { [ { key : '1' } ] }
305333 scroll = { {
306334 x : 'max-content' ,
307335 } }
@@ -310,12 +338,26 @@ const Demo = () => {
310338 < br />
311339 < Table
312340 columns = { columnsGrouped }
313- data = { [ { } , { } ] }
341+ data = { [ { key : '1' } , { key : '2' } ] }
314342 scroll = { {
315343 x : 'max-content' ,
316344 } }
317345 sticky
318346 />
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+ />
319361 </ div >
320362 ) ;
321363} ;
0 commit comments