eui icon indicating copy to clipboard operation
eui copied to clipboard

[EuiInMemoryTable] Issue with sorting

Open sebelga opened this issue 3 years ago • 0 comments

I found an issue with the sorting behaviour of the InMemoryTable.

It does not update the prevProps object on the state (getDerivedStateFromProps()) whenever the sorting prop changes (here https://github.com/elastic/eui/blob/main/src/components/basic_table/in_memory_table.tsx#L320)

Because of that, the if condition is always evaluated against the first value passed as prop (e.g. { sortName: 'foo', sortDirection: 'desc' }) and that column can't toggle the sort direction.

sebelga avatar Jul 06 '22 17:07 sebelga

@chandlerprall Do you have an update when you could have a look into this? cheers 👍

sebelga avatar Sep 07 '22 15:09 sebelga

I can start digging into this on Friday

chandlerprall avatar Sep 07 '22 21:09 chandlerprall