We ran into this problem when working on #7038.
When all checkboxes on the table are checked, tableselect checks the table header checkbox programmatically. The problem is that this programmatic checking doesn't trigger a change event, which makes it impossible to run other actions like showing the table row to "select all items on all pages" in that issue.
I believe the solution is to add a trigger('change') command to this line, but I haven't tested this.