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

[TablePagination] Negative amount of items #8431

Closed
defint opened this issue Sep 28, 2017 · 1 comment
Closed

[TablePagination] Negative amount of items #8431

defint opened this issue Sep 28, 2017 · 1 comment
Labels
bug 🐛 Something doesn't work 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.

Comments

@defint
Copy link

defint commented Sep 28, 2017

If table doesn't have any items – label with negative amount of items appears, after changing "row per page".

Current Behavior

Screenshot: https://tppr.me/RcnqD

Steps to Reproduce

  1. https://codesandbox.io/s/91pzrylyzo
  2. Select "Row per page:" = 25
  3. You can see: "-24-0 of 0" and button "prev page" is available to click

How to fix

https://github.com/callemall/material-ui/blob/v1-beta/src/Table/TablePagination.js#L122
On this line result will be -1, if count is 0.
Using Math.max(0,) have to fix this bug.

Environment

Tech Version
Material-UI 1.0.0-beta.12
React 15.6.1
browser Chrome, Safari
@oliviertassinari oliviertassinari added bug 🐛 Something doesn't work 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. v1 labels Sep 28, 2017
@leMaik
Copy link
Member

leMaik commented Sep 28, 2017

Whoops... didn't think about edge cases. 😓 I'll look into this!

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: 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.
Projects
None yet
Development

No branches or pull requests

3 participants