-
Notifications
You must be signed in to change notification settings - Fork 2
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
currentPageOutOfRange bug fix #223
base: master
Are you sure you want to change the base?
Conversation
If page is greater than 1 throws currentPageOutOfRange error becouse the comparison is wrong, it need to be equal o more than 1 or less than max pages.
Hi @crowd-studio, thanks for the PR. I'm not sure that the original is wrong, though. The point of the original is that 1 is a valid page (regardless of the value from Could you provide a code example that shows the failure you describe please? That'll help us work out the way forward here. |
Hi @sampart Sorry for my bad english: The Now is:
So, returns true (out of range) if page is numbered greater than 1 and is greater than the maximum (NbPages) and return false (in the range) if is numbered 1 or less. Only will work with page number 1, if you try any other page it will throw 'out of range' error. This is incorrect. It should be:
Returns true (out of range) if page is numbered less than one ore greater than the maximum number of pages (NbPages) and returns false (in the range) if page is numbered between 1 and maximum number of pages (NbPages). |
Hi again, The case of the page number being less than 1 is already covered by the You said:
This is only true if In short, I'm not sure a change is needed here - the < 1 case is covered already, and the existing logic in As I said, if you could show me some code of yours that is erroring because of the current behaviour, that would be helpful here. Thanks |
My code:
If |
Sorry, I'm still confused by your example. You claim that you're passing in a value of
This will return If this is returning |
If page is greater than 1 throws currentPageOutOfRange error becouse the comparison is wrong, it need to be equal o more than 1 or less than max pages.