diff --git a/components/lib/datatable/TableBody.js b/components/lib/datatable/TableBody.js index 0107e1e667..20ea157c3d 100644 --- a/components/lib/datatable/TableBody.js +++ b/components/lib/datatable/TableBody.js @@ -910,34 +910,30 @@ export const TableBody = React.memo( }); const createEmptyContent = () => { - if (!props.loading) { - const colSpan = getColumnsLength(); - const content = ObjectUtils.getJSXElement(props.emptyMessage, { props: props.tableProps, frozen: props.frozenRow }) || localeOption('emptyMessage'); - const emptyMessageProps = mergeProps( - { - className: cx('emptyMessage'), - role: 'row' - }, - ptm('emptyMessage') - ); - - const bodyCellProps = mergeProps( - { - colSpan, - role: 'cell' - }, - getColumnPTOptions('root'), - getColumnPTOptions('bodyCell') - ); + const colSpan = getColumnsLength(); + const content = ObjectUtils.getJSXElement(props.emptyMessage, { props: props.tableProps, frozen: props.frozenRow }) || localeOption('emptyMessage'); + const emptyMessageProps = mergeProps( + { + className: cx('emptyMessage'), + role: 'row' + }, + ptm('emptyMessage') + ); - return ( - - {content} - - ); - } + const bodyCellProps = mergeProps( + { + colSpan, + role: 'cell' + }, + getColumnPTOptions('root'), + getColumnPTOptions('bodyCell') + ); - return null; + return ( + + {content} + + ); }; const createGroupHeader = (rowData, rowIndex, expanded, colSpan) => { diff --git a/components/lib/dataview/DataView.js b/components/lib/dataview/DataView.js index 6ff493a60a..1b5b2fc0b3 100644 --- a/components/lib/dataview/DataView.js +++ b/components/lib/dataview/DataView.js @@ -217,19 +217,15 @@ export const DataView = React.memo( }; const createEmptyMessage = () => { - if (!props.loading) { - const content = props.emptyMessage || localeOption('emptyMessage'); - const emptyMessageProps = mergeProps( - { - className: cx('emptyMessage') - }, - ptm('emptyMessage') - ); - - return
{content}
; - } + const content = props.emptyMessage || localeOption('emptyMessage'); + const emptyMessageProps = mergeProps( + { + className: cx('emptyMessage') + }, + ptm('emptyMessage') + ); - return null; + return
{content}
; }; const createHeader = () => { diff --git a/components/lib/treetable/TreeTableBody.js b/components/lib/treetable/TreeTableBody.js index fb7e91bd2c..5f63f274a4 100644 --- a/components/lib/treetable/TreeTableBody.js +++ b/components/lib/treetable/TreeTableBody.js @@ -232,10 +232,6 @@ export const TreeTableBody = React.memo((props) => { }; const createEmptyMessage = () => { - if (props.loading) { - return null; - } - const colSpan = props.columns ? props.columns.length : null; const content = ObjectUtils.getJSXElement(props.emptyMessage, { props: props.tableProps }) || localeOption('emptyMessage'); const emptyMessageProps = mergeProps(