diff --git a/packages/ui/src/components/Table/components/Table.tsx b/packages/ui/src/components/Table/components/Table.tsx index e5f519b8e5..6ad1fa96ae 100644 --- a/packages/ui/src/components/Table/components/Table.tsx +++ b/packages/ui/src/components/Table/components/Table.tsx @@ -62,8 +62,13 @@ function useDisabledRows({ function useLiveRegionLabel( pagination: TablePaginationType, isStale: boolean, + isLoading: boolean, hasData: boolean, ): string { + if (isLoading) { + return 'Loading table data.'; + } + if (!hasData || pagination.type === 'none') { return ''; } @@ -126,9 +131,12 @@ export function Table({ ); } - const liveRegionLabel = isInitialLoading - ? 'Loading table data.' - : useLiveRegionLabel(pagination, isStale, data !== undefined); + const liveRegionLabel = useLiveRegionLabel( + pagination, + isStale, + isInitialLoading, + data !== undefined, + ); const manualColumnSizing = columnConfig.some( col =>