refactor(DataTable): simplify aria-sort assignment for better readability

This commit is contained in:
Marco Beretta
2025-11-12 15:32:37 +01:00
parent ab706ecf70
commit 7958401979

View File

@@ -538,11 +538,11 @@ function DataTable<TData extends Record<string, unknown>, TValue>({
tabIndex={canSort ? 0 : undefined}
aria-label={sortAriaLabel}
aria-sort={
header.column.getIsSorted() as
| 'ascending'
| 'descending'
| 'none'
| undefined
header.column.getIsSorted() === 'asc'
? 'ascending'
: header.column.getIsSorted() === 'desc'
? 'descending'
: undefined
}
>
{isSelectHeader ? (