Skip to content

Checkbox column appended instead of prepended in concurrent mode #1562

@eps1lon

Description

@eps1lon

If you can point me to the code that's responsible for inserting the column I can take a look to understand what's going wrong if you want.

Current Behavior 😯

When using <DataGrid checkboxSelection /> the column containing the checkboxes is the last column in concurrent react.

screenshot of the current behavior

Expected Behavior 🤔

It should be the first column

screenshot of the expected behavior

Steps to Reproduce 🕹

https://codesandbox.io/s/datagrid-legacy-vs-concurrent-root-84z9o?file=/demo.js

Steps:

  1. Use react@experimental (currently 0.0.0-experimental-79740da4c)
  2. render <DataGrid rows={rows} columns={columns} pageSize={5} checkboxSelection />

Context 🔦

Reproducible in our docs: https://60906bee09db3300076bbe72--material-ui.netlify.app/components/tables/#DataTable (mui/material-ui#26107)

Your Environment 🌎

See codesandbox. For the docs see the details below.

`npx @material-ui/envinfo`
System:
    OS: Linux 5.4 Ubuntu 20.04.2 LTS (Focal Fossa)
  Binaries:
    Node: 12.20.0 - ~/.nvm/versions/node/v12.20.0/bin/node
    Yarn: 1.22.10 - /usr/bin/yarn
    npm: 6.14.8 - ~/.nvm/versions/node/v12.20.0/bin/npm
  Browsers:
    Chrome: 90.0.4430.72
    Firefox: 88.0
  npmPackages:
    @emotion/react: ^11.0.0 => 11.1.5 
    @emotion/styled: ^11.0.0 => 11.3.0 
    @material-ui/codemod:  5.0.0-alpha.30 
    @material-ui/core:  5.0.0-alpha.32 
    @material-ui/data-grid:  4.0.0-alpha.27 
    @material-ui/docs:  5.0.0-alpha.31 
    @material-ui/envinfo:  1.1.6 
    @material-ui/icons:  5.0.0-alpha.29 
    @material-ui/lab:  5.0.0-alpha.32 
    @material-ui/private-theming:  5.0.0-alpha.32 
    @material-ui/styled-engine:  5.0.0-alpha.26 
    @material-ui/styled-engine-sc:  5.0.0-alpha.26 
    @material-ui/styles:  5.0.0-alpha.32 
    @material-ui/system:  5.0.0-alpha.31 
    @material-ui/types:  6.0.0 
    @material-ui/unstyled:  5.0.0-alpha.32 
    @material-ui/utils:  5.0.0-alpha.31 
    @types/react: ^17.0.3 => 17.0.4 
    react: ^17.0.1 => 0.0.0-experimental-79740da4c 
    react-dom: ^17.0.1 => 0.0.0-experimental-79740da4c 
    styled-components:  5.2.3 
    typescript: ^4.1.2 => 4.2.4 

Order id 💳

N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope: data gridChanges related to the data grid.type: bugIt doesn't behave as expected.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions