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

v-pagination doesn't handle float length #1248

Closed
juan-tonina opened this issue Aug 4, 2017 · 1 comment
Closed

v-pagination doesn't handle float length #1248

juan-tonina opened this issue Aug 4, 2017 · 1 comment
Assignees
Labels
T: enhancement Functionality that enhances existing features

Comments

@juan-tonina
Copy link

When using a length that is not an int number, the v-pagination component does not disable the "next page" button, and allows the user to move forward infinitely.

Of course, any non integer length is silly, but a careless dev (me) could create a pagination with :length.number="total/pageSize" and forget to Math.ceil/round...

The behavior changes when

  • lenght < 6
  • length >6 && length < 7
  • length > 7
    A side effect of this, is that the float number overflows the button because of rounding errors, but I'm guessing this won't be a problem once the floats are handled. (It seems to be working fine for relatively large int numbers)

Steps to reproduce

Create a v-pagination with a :length.number=<float> (6.4 for extra weirdness)

Versions

Vuetify 0.14.8, chrome 59 on W10

What is expected ?

Length should be rounded up. or maybe throw an error (I guess that rounding is better, because it is less frustrating for the dev)

What is actually happening ?

  • if length <6: As the page increments by 1, you never reach the highest number
  • if length > 6 && < 7: buttons show float labels, that increment by 1
  • if length > 7: the first buttons are ok, the last button shows the number as float

Reproduction Link

https://codepen.io/anon/pen/OjboNO

@johnleider johnleider added the T: enhancement Functionality that enhances existing features label Aug 5, 2017
@johnleider johnleider self-assigned this Aug 5, 2017
@lock
Copy link

lock bot commented Apr 16, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: enhancement Functionality that enhances existing features
Projects
None yet
Development

No branches or pull requests

2 participants