diff --git a/semcore/data-table/src/components/Body/Body.tsx b/semcore/data-table/src/components/Body/Body.tsx index 89c8f92c43..8723b5e04b 100644 --- a/semcore/data-table/src/components/Body/Body.tsx +++ b/semcore/data-table/src/components/Body/Body.tsx @@ -395,6 +395,7 @@ class BodyRoot extends Component = { render: LoadingWithScrollAndButtonExample, + argTypes: { + h: { type: 'number' }, + }, }; export const LoadingPagination: Story = { diff --git a/stories/components/data-table/tests/examples/table-states-tests/loading-with-button-and-scroll.tsx b/stories/components/data-table/tests/examples/table-states-tests/loading-with-button-and-scroll.tsx index 55928dce31..ee3b1e6398 100644 --- a/stories/components/data-table/tests/examples/table-states-tests/loading-with-button-and-scroll.tsx +++ b/stories/components/data-table/tests/examples/table-states-tests/loading-with-button-and-scroll.tsx @@ -3,7 +3,7 @@ import Button from '@semcore/ui/button'; import { DataTable } from '@semcore/ui/data-table'; import React from 'react'; -const Demo = (): any => { +const Demo = (props: { h?: number }): any => { const [loading, setLoading] = React.useState(true); const [message, setMessage] = React.useState(''); @@ -23,6 +23,9 @@ const Demo = (): any => { return ( <> + {message} @@ -30,7 +33,7 @@ const Demo = (): any => { data={data} aria-label='Loading using SpinContainer' loading={loading} - h={150} + h={props.h === 0 ? undefined : props.h} columns={[ { name: 'keyword', children: 'Keyword' }, { name: 'kd', children: 'KD,%' }, @@ -38,14 +41,11 @@ const Demo = (): any => { { name: 'vol', children: 'Vol.' }, ]} /> - ); }; -const data = [ +const dataTest = [ { keyword: 'ebay buy', kd: '77.8', @@ -78,4 +78,8 @@ const data = [ }, ]; +const data = new Array(200).fill(null).map((_, index) => { + return dataTest[index % 4]; +}); + export default Demo;