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

Table Pagination : Header and Rows shift with pagination click #20804

Closed
ankitasingh170190 opened this issue Apr 27, 2020 · 7 comments · Fixed by #20873
Closed

Table Pagination : Header and Rows shift with pagination click #20804

ankitasingh170190 opened this issue Apr 27, 2020 · 7 comments · Fixed by #20873
Labels
component: table This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process.

Comments

@ankitasingh170190
Copy link
Contributor

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

Current Behavior 😯

When we click on the Table Pagination the headers and rows element shift horizontally with page click.

Expected Behavior 🤔

The table elements should not shift their positioning with page switch.

Steps to Reproduce 🕹

https://material-ui.com/components/tables/#custom-pagination-actions Switch between pages in the example provided to notice the behavior. Thank you.

@ankitasingh170190 ankitasingh170190 changed the title Header and Rows shift with pagination click Table Pagination : Header and Rows shift with pagination click Apr 27, 2020
@oliviertassinari oliviertassinari added component: table This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. docs Improvements or additions to the documentation labels Apr 27, 2020
@oliviertassinari
Copy link
Member

@ankitasingh170190 Thanks for the report. What do you think of this diff? Do you want to submit a pull request? :)

diff --git a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
index 601be11f8..005000007 100644
--- a/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
+++ b/docs/src/pages/components/tables/CustomPaginationActionsTable.tsx
@@ -137,8 +137,8 @@ export default function CustomPaginationActionsTable() {
               <TableCell component="th" scope="row">
                 {row.name}
               </TableCell>
-              <TableCell align="right">{row.calories}</TableCell>
-              <TableCell align="right">{row.fat}</TableCell>
+              <TableCell style={{ width: 160 }} align="right">{row.calories}</TableCell>
+              <TableCell style={{ width: 160 }} align="right">{row.fat}</TableCell>
             </TableRow>
           ))}
           {emptyRows > 0 && (

@ankitasingh170190
Copy link
Contributor Author

ankitasingh170190 commented Apr 27, 2020

I am trying to see if there is a way we can dynamically change the width incase we are not aware of the data we will be showing ? I will keep you updated if I find a solution for the same. Thank you.

@oliviertassinari
Copy link
Member

@ankitasingh170190 Auto layout is likely something we will support in the upcoming DataGrid component @dtassone is working on.

@ankitasingh170190
Copy link
Contributor Author

@ankitasingh170190 Auto layout is likely something we will support in the upcoming DataGrid component @dtassone is working on.

wow that is awesome. Cannot wait for the release. I will submit a PR for this issue. Thank you.

@uneet7
Copy link
Contributor

uneet7 commented May 1, 2020

Can I work on this?

@marcosvega91
Copy link
Contributor

@ankitasingh170190 are you working on this ?

@ankitasingh170190
Copy link
Contributor Author

ankitasingh170190 commented May 2, 2020

@ankitasingh170190 are you working on this ?

yup. #20873

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: table This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation good first issue Great for first contributions. Enable to learn the contribution process.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants