Count if pagination bar is used will be displayed accurately as 4 (selected records are 2,3,4 and 5).
Now select 1st record , you'll be able to see that records 1 and 2 are selected which is expected behavior but the count on pagination will be 5 (It will maintain history as 3,4 and 5 are also selected).
This seems to be a major flaw and needs to e resolved asap.
Steps to reproduce