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] Rows are not rendered when previous rows were scrolled down #1444

Closed
2 tasks done
kzviagina opened this issue Apr 20, 2021 · 4 comments · Fixed by #1451
Closed
2 tasks done

[DataGrid] Rows are not rendered when previous rows were scrolled down #1444

kzviagina opened this issue Apr 20, 2021 · 4 comments · Fixed by #1451
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! priority: important This change can make a difference

Comments

@kzviagina
Copy link

When rows data changes, so the amount of new rows is smaller than previous, rows are not rendered. This seem to reproduce only if new amount of rows is less than 10.

  • 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 😯

Updated rows are not rendered (not added to DOM)

Expected Behavior 🤔

Updated rows are added to DOM and visible

Steps to Reproduce 🕹

Code sandbox:
https://codesandbox.io/s/not-rendered-items-rl2v0?file=/demo.tsx

Steps:

  1. Press button to show 100 rows
  2. Scroll down scrolls to the middle of the list
  3. Press button to show 9 rows
  4. Rows are not visible and not even added to DOM, but pagination shows that there are 9 items.
  5. Press button to show 100 rows
  6. Scroll down scrolls to the middle of the list
  7. Press button to show 10 rows
  8. Rows are visible.

Context 🔦

We display search results in grid. When search criteria is updated and new data is fetched, rows are not visible in case the amount of items is less than 10.

Your Environment 🌎

`npx @material-ui/envinfo`
  System:
    OS: macOS 10.15.4
  Binaries:
    Node: 12.16.1 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 6.13.4 - /usr/local/bin/npm
  Browsers:
    Chrome: 89.0.4389.128
  npmPackages:
    @material-ui/core: ^4.11.3 => 4.11.3 
    @material-ui/data-grid: ^4.0.0-alpha.22 => 4.0.0-alpha.22 
    @material-ui/icons: ^4.11.2 => 4.11.2 
    @material-ui/pickers: ^3.2.10 => 3.2.10 
    @material-ui/styles:  4.11.3 
    @material-ui/system:  4.11.3 
    @material-ui/types:  5.1.0 
    @material-ui/utils:  4.11.2 
    @material-ui/x-grid: ^4.0.0-alpha.24 => 4.0.0-alpha.24 
    @material-ui/x-license:  4.0.0-alpha.21 
    @types/react: ^17.0.2 => 17.0.2 
    react: ^17.0.1 => 17.0.1 
    react-dom: ^17.0.1 => 17.0.1 
    typescript: ^4.2.2 => 4.2.2 

Order id 💳

23597

@kzviagina kzviagina added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 20, 2021
@kzviagina kzviagina changed the title [XGrid][DataGrid] Rows are not rendered, when previous rows was scrolled down [XGrid][DataGrid] Rows are not rendered, when previous rows were scrolled down Apr 20, 2021
@kzviagina kzviagina changed the title [XGrid][DataGrid] Rows are not rendered, when previous rows were scrolled down [XGrid][DataGrid] Rows are not rendered when previous rows were scrolled down Apr 20, 2021
@dtassone dtassone added bug 🐛 Something doesn't work priority: important This change can make a difference and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Apr 20, 2021
@kzviagina
Copy link
Author

Hey @dtassone! Do you know the root cause of this issue or workaround?

@oliviertassinari
Copy link
Member

@kzviagina This is a regression from 4.0.0-alpha.24. It works in 4.0.0-alpha.23. More specifically it was broken in #1253.

@dtassone I would encourage us to explore how we can remove the isVirtualized branching. It seems to only partially solve the problem, e.g. #414 is still present. And it seems to have lead to this regression and #1334. I personally fail to understand why we fork the rendering and even more why inside useGridContainerProps not useGridVirtualRows.

@oliviertassinari oliviertassinari changed the title [XGrid][DataGrid] Rows are not rendered when previous rows were scrolled down [DataGrid] Rows are not rendered when previous rows were scrolled down Apr 21, 2021
@oliviertassinari oliviertassinari added the component: data grid This is the name of the generic UI component, not the React module! label Apr 21, 2021
@dtassone
Copy link
Member

@kzviagina Bug fixed. We are planning to release today :)

@kzviagina
Copy link
Author

@dtassone @oliviertassinari thank you for the fix and clarification! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! priority: important This change can make a difference
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants