Skip to content

Table sorting doesn't re-render #5253

Closed
@aelgasser

Description

Environment

  • Package version(s): 4.1.2 (same issue since 4.0.0-rc.3, see below)
  • Operating System: MacOS 12.2
  • Browser name and version: Chrome 99.0.4844.83

Code Sandbox

Link to a minimal repro (fork this code sandbox):

https://codesandbox.io/s/blueprint-sandbox-forked-4-1-2-not-working-ndf821?file=/src/TableSortableExample.tsx

The code has been copy/pasted with [almost] no modification from :

Steps to reproduce

  1. Create a table with column sorting
  2. Try to sort data from any column
  3. It should refresh the table with data sorted by that column immediately

Actual behavior

The sort command is taken into account but the table doesn't re-render with the newly sorted data.
I have to scroll into the table (and thus the table must have scrollbars; see app.css in the sandbox) to see the changes.

Expected behavior

The table should re-render without user interaction.

Possible solution

This seems to be a regression between versions 4.0.0-rc.1 and 4.0.0-rc.3 of the table component. See the same sandbox here but running version 4.0.0-rc.1 which is working fine (I even removed the scrollbars) :
https://codesandbox.io/s/blueprint-sandbox-forked-4-0-0-rc-1-working-zqhugl?file=/src/TableSortableExample.tsx

I couldn't test version 4.0.0-rc.2 in the sandbox as it's crashing on some Typescript issue ((0 , $csb__tslib.__spreadArray) is not a function).

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions