Sorry I have seen this question has been asked many times in different ways here such as:
So I think I solved it by a comment inspired by the github issue mentioned above:
Supposing you have this array and you are sorting ascending
A,
B,
C,
D,
E,
F,
And you have a page limnit of 2 results
Then when you are in the third page you should have
E,
F
Now you need to go to previous page and what you need todo is:
[F,E,D,C,B,A]
E
and that is [D,C]
[C,D]