I have an issue with the Lightning Datatable which dispatches an event when a column header is clicked. That event holds among other things the sorting order, 'asc' or 'desc'.

The problem is that the given order is always 'asc'. Despite the docs specifying otherwise :

Clicking a column header sorts rows by ascending order unless the defaultSortDirection is changed, and clicking it subsequently reverses the order

Here is a playground link that shows the error (click on a column to sort and observe the given sorting order in the console) :


Am I missing a parameter or something ?

Thank you in advance !

  • 1
    Can you share the minimum viable code to reproduce the issue? Dec 11, 2019 at 17:59
  • 1
    Or Playground link? Dec 11, 2019 at 19:42
  • Hello, thank you for your answers, I just added a playground link showing the problem
    – Ombrelin
    Dec 12, 2019 at 13:12
  • 1
    I have identified this problem as a potential duplicate, but if the related answer doesn't solve your problem, please let us know, and we'll be glad to re-open it for you. I have updated your playground to demonstrate the missing attributes.
    – sfdcfox
    Dec 12, 2019 at 13:39


Browse other questions tagged .