Duplicate and missing records/rows when navigating table pages
I was looking for a record in an "Orders" table, that I new existed, and I wasn't able to find it while navigating the 10 record per page table pages. I then set the table to show all records, which revealed the record I was looking for. Also, when navigating between pages, I see the same records on different pages (see screen recording)
When setting a filter for the order date, for some reason, the record shows on page 2 when navigating the table pages, and the same records don't appear on different pages.
Does anyone know why this is?
9 Replies
@nowak I'm seeing that exact same issue too. Did you figure it out?
No I did not, but please let me know if you find an answer for this
difficult to assist you without code. Maybe you could create a minimal repo on github to reproduce this issue
I am not sure exactly how to reproduce it exactly yet, as I remember it being a bit random.
@martin-ro is your use case easy to reproduce?
Yes, meanwhile I have figured it out. The minimal reproducible setup would be a table with
->defaultSort('created_at', 'desc')
or a TextColumn::make('created_at')->sortable()
with records that have identical created_at
timestamps.
The way to solve that for me was:
The second defaultSort
fixed it for me @nowak
This also works:
Wow. Good catch @martin-ro!
@Leandro Ferreira I am not able to test this out and create a minimal repo on github any time soon, but if no one has made an issue on github about this before I have more time available, I will do it then.
Yes, a GH issue with the fix would be a good start so the problem gets visible/searchable for others.
I see this more as a workaround than a fix. Records should not be missing in tables and the same record should not be shown on multiple table pages in the first place
yeah, that's a better description. The default is certainly not expected behaviour, so it's a bug.