Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Datagrid] Lag and Performance Issues using [Autocomplete] component with RenderCell #1576

Closed
reigj1 opened this issue May 6, 2021 · 5 comments
Labels
performance status: waiting for author Issue with insufficient information

Comments

@reigj1
Copy link

reigj1 commented May 6, 2021

The issue is present in the latest release.
I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior

Using material ui Datagrid with RenderCell with Autocomplete component the page starts lagging too much.

Expected Behavior

I didnt expect this lag and it does not happen usually on the example datagrids. It works without lagging

Steps to Reproduce

Steps:

Visit https://codesandbox.io/s/material-demo-forked-fqigr
Try to move from left to right on the datagrid
The datagrid will lag a lot

Code example of the custom column:

{
    field: "lastName",
    headerName: "lastName1",
    disableClickEventBubbling: true,
    width: 200,
    renderCell: (params1) => {
      return (
        <Autocomplete
          options={["1", "2"]}
          defaultValue={params1.getValue("lastName")}
          getOptionLabel={(option) => option}
          style={{ width: "100%", paddingTop: 20 }}
          renderInput={(params) => (
            <TextField
              {...params}
              defaultValue={params1.getValue("lastName")}
            />
          )}
        />
      );
    }
  }
@reigj1 reigj1 changed the title Material-UI Datagrid Lag and Performance Issues using Autocomplete component with RenderCell Datagrid Lag and Performance Issues using Autocomplete component with RenderCell May 6, 2021
@reigj1 reigj1 changed the title Datagrid Lag and Performance Issues using Autocomplete component with RenderCell [Datagrid] Lag and Performance Issues using [Autocomplete] component with RenderCell[ May 6, 2021
@reigj1 reigj1 changed the title [Datagrid] Lag and Performance Issues using [Autocomplete] component with RenderCell[ [Datagrid] Lag and Performance Issues using [Autocomplete] component with RenderCell May 6, 2021
@eps1lon eps1lon transferred this issue from mui/material-ui May 6, 2021
@oliviertassinari oliviertassinari added the status: waiting for author Issue with insufficient information label May 6, 2021
@oliviertassinari
Copy link
Member

@reygj The reproduction is invalid, please cleanup the error first. e.g. "Warning: Encountered two children with the same key, lastName"

@oliviertassinari
Copy link
Member

Also a bit similar to #569 (comment)

It seems that TextField is simply too slow for this use case.

@dtassone
Copy link
Member

dtassone commented May 6, 2021

I suggest we take a look at this issue after we merge #1513

@reigj1
Copy link
Author

reigj1 commented May 7, 2021

Tried to replace TextField with a simple div, still lags a bit but way better than before, now I'm thinking anyway to replace the Textfield with something similar that doesnt lag as much?

Example: https://codesandbox.io/s/material-demo-forked-3g7u6

@oliviertassinari
Copy link
Member

I'm closing as the reproduction is not valid (#1576 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance status: waiting for author Issue with insufficient information
Projects
None yet
Development

No branches or pull requests

3 participants