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

[data grid] onRowsScrollEnd triggered instantly when using a bottom pinned row #12973

Closed
martin-mael opened this issue May 2, 2024 · 12 comments · Fixed by #14602
Closed

[data grid] onRowsScrollEnd triggered instantly when using a bottom pinned row #12973

martin-mael opened this issue May 2, 2024 · 12 comments · Fixed by #14602
Assignees
Labels
bug 🐛 Something doesn't work component: data grid This is the name of the generic UI component, not the React module! feature: Row loading Related to the data grid Row loading features feature: Row pinning Related to the data grid Row pinning feature support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/

Comments

@martin-mael
Copy link

martin-mael commented May 2, 2024

Steps to reproduce

Link to live example: (required)

Steps:

  1. Create a Datagrid, with enough rows to be scrollable and pass a function to onRowsScrollEnd

Check the example : https://stackblitz.com/edit/react-kvryv4?file=Demo.tsx

Notice how the second page load is triggered instantly, and how scrolling doesn't trigger a new page load.

Current behavior

The function passed to onRowsScrollEnd is called instantly, and not when the main container of the datagrid reaches its bottom scroll area.

Same behavior using Chrome, Firefox and Safari latest.

Expected behavior

The function passed to onRowsScrollEnd should only be called when scrolling to the bottom of the grid.

Context

My code is working correctly using version 6.19.11 (latest v6 version as of date). I was migrating mui-x pro packages to v7, and my infinite scroll pagination broke. It works correctly when removing the bottom pinned row (it's used to represent totals).

Your environment

npx @mui/envinfo
  System:
    OS: macOS 14.4.1
  Binaries:
    Node: 20.3.1 - ~/.nvm/versions/node/v20.3.1/bin/node
    npm: 9.6.7 - ~/.nvm/versions/node/v20.3.1/bin/npm
    pnpm: Not Found
  Browsers:
    Chrome: 124.0.6367.118
    Edge: Not Found
    Safari: 17.4.1
  npmPackages:
    @emotion/react: ^11.11.4 => 11.11.4
    @emotion/styled: ^11.11.5 => 11.11.5
    @mui/base:  5.0.0-beta.40
    @mui/core-downloads-tracker:  5.15.15
    @mui/icons-material: ^5.15.15 => 5.15.15
    @mui/lab: ^5.0.0-alpha.170 => 5.0.0-alpha.170
    @mui/material: ^5.15.15 => 5.15.15
    @mui/private-theming:  5.15.14
    @mui/styled-engine:  5.15.14
    @mui/system:  5.15.15
    @mui/types:  7.2.14
    @mui/utils:  5.15.14
    @mui/x-data-grid:  6.19.11
    @mui/x-data-grid-pro: ^6.19.11 => 6.19.11
    @mui/x-date-pickers:  6.19.9
    @mui/x-date-pickers-pro: ^6.19.9 => 6.19.9
    @mui/x-license-pro: ^6.10.2 => 6.10.2
    @types/react: ^18.3.1 => 18.3.1
    react: ^18.3.1 => 18.3.1
    react-dom: ^18.3.1 => 18.3.1
    typescript: ^5.4.5 => 5.4.5

Search keywords: onRowsScrollEnd bottom pinned row v7
Order ID: 83724

@martin-mael martin-mael added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label May 2, 2024
@michelengelen michelengelen changed the title onRowsScrollEnd triggered instantly when using a bottom pinned row [data grid] onRowsScrollEnd triggered instantly when using a bottom pinned row May 2, 2024
@michelengelen michelengelen added support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/ component: data grid This is the name of the generic UI component, not the React module! labels May 2, 2024
@michelengelen
Copy link
Member

Ok, I can confirm this is a buug on our end.
One thing to note about the demo: you were incorrectly spreading the row onto the pinned row

-pinnedRows={{ bottom: [{ id: 'abc', ...rows[0] }] }}
+pinnedRows={{ bottom: [{ ...rows[0] }], id: 'abc' }}

This way the id property will get overwritten so we do not have a duplicate id in the grid.

@DanailH ... this is your expertise ... do you want to have a look into that? :P

@michelengelen michelengelen added bug 🐛 Something doesn't work feature: Row pinning Related to the data grid Row pinning feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels May 3, 2024
@github-project-automation github-project-automation bot moved this to 🆕 Needs refinement in MUI X Data Grid May 3, 2024
@michelengelen
Copy link
Member

Additional info:
When applying the change mentioned above the onRowsScrollEnd handler will only get called once, not twice like before. Maybe that helps as well 🤷🏼

@martin-mael
Copy link
Author

Oh yes you're right. I arranged the demo quickly and didn't notice the duplicated id. It's not the case in my app code though.

@martin-mael
Copy link
Author

Hello @michelengelen, do you have any updates on this issue ?

@tommy-wl
Copy link

@michelengelen are you able to provide an update, thanks

@michelengelen
Copy link
Member

Sry... I have been on vacation. I'll add it to the board for the team to have a deeper look! Again: sry for the delay!

@tommy-wl
Copy link

tommy-wl commented Jul 19, 2024

Thanks for the reply @michelengelen! If you can provide an ETA, that would be great! (Premium customer)

@forwardslahsdotj
Copy link

@michelengelen Do you have any update on this or an ETA?

@forwardslahsdotj
Copy link

@michelengelen Looking for an update on this or an ETA. Premium customer - Support ID: 96081

@michelengelen
Copy link
Member

We did not schedule this yet ... I'll ask the team if we can move it up in priority.

@forwardslahsdotj
Copy link

Thank you!

@arminmeh arminmeh moved this from 🆕 Needs refinement to 🏗 In progress in MUI X Data Grid Sep 12, 2024
@arminmeh arminmeh self-assigned this Sep 12, 2024
@arminmeh arminmeh added the feature: Row loading Related to the data grid Row loading features label Sep 12, 2024
@arminmeh arminmeh moved this from 🏗 In progress to 👀 In review in MUI X Data Grid Sep 13, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

We value your feedback @martin-mael! How was your experience with our support team?
If you could spare a moment, we'd love to hear your thoughts in this brief Support Satisfaction survey. Your insights help us improve!

@arminmeh arminmeh moved this from 👀 In review to ✅ Done in MUI X Data Grid Sep 13, 2024
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! feature: Row loading Related to the data grid Row loading features feature: Row pinning Related to the data grid Row pinning feature support: pro standard Support request from a Pro standard plan user. https://mui.com/legal/technical-support-sla/
Projects
Status: Done
5 participants