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] Page auto scroll to top when we close the open filterpanel #7696

Closed
2 tasks done
ayushcs opened this issue Jan 25, 2023 · 1 comment
Closed
2 tasks done
Labels
component: data grid This is the name of the generic UI component, not the React module! out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)

Comments

@ayushcs
Copy link

ayushcs commented Jan 25, 2023

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Steps to reproduce 🕹

Steps:

  1. Go to https://mui.com/x/react-data-grid/filtering/ in chrome.
  2. Open the name filter in the first table
  3. Without closing it scroll down (so that you cannot see the table) and then click on the outside you will see the page will scroll to the top where the filter was opened.
    ezgif com-gif-maker

For live example:

https://codesandbox.io/s/customfilterpanelposition-demo-mui-x-forked-57ftx1

Steps:

  1. Open the Name filter
  2. Scroll down to the Rows per page without closing the Name filterpanel (with outer scroll)
  3. You will see it will scroll to the top
filtering.webm

Current behavior 😯

When we open any filterpanel and scroll to bottom and then click it will scroll back to the top again as shown in video
Filtering.webm

Expected behavior 🤔

It should not scroll to the top.

Context 🔦

In my case it is creating issue like when we open the filter and without closing it, we clicked on the rows per page option its changing the position of paper/list (the one which contains list of rows as shown in image) for Rows per page option in DataGrid and make it incorrect, because the page is immediately scrolled to the top while the position of Paper/list is still calculating

image

Your environment 🌎

npx @mui/envinfo
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.

I am using the chrome broswer

System:
OS: Linux 5.15 Ubuntu 20.04.5 LTS (Focal Fossa)
Binaries:
Node: 18.13.0 - /usr/bin/node
Yarn: Not Found
npm: 8.19.3 - /usr/bin/npm
Browsers:
Chrome: 109.0.5414.74
Firefox: 109.0
npmPackages:
@emotion/react: ^11.8.2 => 11.10.4
@emotion/styled: ^11.8.1 => 11.10.4
@mui/base: ^5.0.0-alpha.75 => 5.0.0-alpha.102
@mui/core-downloads-tracker: 5.10.10
@mui/icons-material: ^5.5.1 => 5.10.9
@mui/lab: ^5.0.0-alpha.74 => 5.0.0-alpha.104
@mui/material: ^5.5.1 => 5.10.10
@mui/private-theming: 5.10.9
@mui/styled-engine: 5.10.8
@mui/styles: ^5.5.1 => 5.10.10
@mui/system: ^5.5.2 => 5.10.10
@mui/types: 7.2.0
@mui/utils: ^5.4.4 => 5.10.9
@mui/x-data-grid: ^5.9.0 => 5.17.7
@mui/x-date-pickers: ^5.0.0-alpha.2 => 5.0.4
@types/react: ^17.0.40 => 17.0.50
react: ^17.0.2 => 17.0.2
react-dom: ^17.0.2 => 17.0.2
typescript: ^4.6.2 => 4.8.4

Order ID 💳 (optional)

No response

@ayushcs ayushcs added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 25, 2023
@zannager zannager added the component: data grid This is the name of the generic UI component, not the React module! label Jan 25, 2023
@m4theushw m4theushw removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 25, 2023
@m4theushw
Copy link
Member

This happens because when the filter panel is closed, the TrapFocus tries to restore the focus to the previous element, which is the button. The solution from #7044 (comment) will allow to disable this behavior. For now, there's nothing we can recommended to improve the experience.

@m4theushw m4theushw added the out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future) label Jan 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! out of scope The problem looks valid but we won't fix it (maybe we will revisit it in the future)
Projects
None yet
Development

No branches or pull requests

3 participants