The number of selected items in a table is greater than the number of items in the table

Hi, I am facing this error when selecting all the data in my table using the select all button in the column header row. When I go through all my pages and click the select all, I always end up with an extra result in the footer.

There is 125 items in my table, I have my server-side pagination size set to 100. I also have Persist row selection enabled.

On my table.selectedRowKeys array, it contains 126 items. All of them are using the unique primary key except for 1, number 100 which is undefined.

In the following gif you can see the selected number is incremented by 1 when I select the header even when all items are already selected
example

Any help would be appreciated

1 Like

I've noticed this behavior as well and my best guess is that the select all checkbox is being included in the array of selected rows (which could explain the undefined row data).

Yes, I agree. Thank you.

I cant see an easy way to fix this either.

Hopefully retool support are aware of this bug

Hello @Catapult_John and @pyrrho! Thank you for your feedback, we added it to an existing bug report for this issue. :memo:

1 Like