Skip to content

Commit d9a4ef9

Browse files
authored
Merge pull request #958 from CopperGiraffe/fix-sort-datatable
fix: 🐛 la fonction de tri par défaut sur le DsfrDataTable
2 parents 84f0061 + f6f60b6 commit d9a4ef9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/DsfrDataTable/DsfrDataTable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const lowestLimit = computed(() => currentPage.value * rowsPerPage.value)
6565
const highestLimit = computed(() => (currentPage.value + 1) * rowsPerPage.value)
6666
6767
function defaultSortFn (a: string | DsfrDataTableRow, b: string | DsfrDataTableRow) {
68-
const key = props.sorted as string
68+
const key = sortedBy.value ?? props.sorted
6969
// @ts-expect-error TS7015
7070
if (((a as DsfrDataTableRow)[key] ?? a) < ((b as DsfrDataTableRow)[key] ?? b)) {
7171
return -1

0 commit comments

Comments
 (0)