Skip to content

Commit

Permalink
Merge pull request #958 from CopperGiraffe/fix-sort-datatable
Browse files Browse the repository at this point in the history
fix: 🐛 la fonction de tri par défaut sur le DsfrDataTable
  • Loading branch information
laruiss authored Oct 21, 2024
2 parents 84f0061 + f6f60b6 commit d9a4ef9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/DsfrDataTable/DsfrDataTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const lowestLimit = computed(() => currentPage.value * rowsPerPage.value)
const highestLimit = computed(() => (currentPage.value + 1) * rowsPerPage.value)
function defaultSortFn (a: string | DsfrDataTableRow, b: string | DsfrDataTableRow) {
const key = props.sorted as string
const key = sortedBy.value ?? props.sorted
// @ts-expect-error TS7015
if (((a as DsfrDataTableRow)[key] ?? a) < ((b as DsfrDataTableRow)[key] ?? b)) {
return -1
Expand Down

0 comments on commit d9a4ef9

Please sign in to comment.