radzen-blazor icon indicating copy to clipboard operation
radzen-blazor copied to clipboard

Pager OnPageSizeChanged method bug

Open compassalex opened this issue 3 years ago • 2 comments

Describe the bug When using the PageSizeOptions and you have a Count that is able to be shown all on one page and you switch to a page size that doesn't fit all the records on one page, the page number changes to the last page rather than staying on the first page as expected.

To Reproduce

  1. Create a blazor .net 6 project with all the default options, perform the initial Radzen set up and replace the contents of Index.razor with the below. @page "/"

<PageTitle>Index</PageTitle>

@code{ private List _words = new() { "1", "2", "3", "4", "5" }; private int[] _pageSizes = new int[] { 10, 2 }; }

  1. Change the page size from 10 to 2 and it will change the page number to 3 (last page)

Expected behavior I think the page index should not change from 0 when performing this action

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser Edge
  • Version 101

Additional context Having looked at the OnPageSizeChanged method - https://github.com/radzenhq/radzen-blazor/blob/master/Radzen.Blazor/RadzenPager.razor.cs

I think the if (isLastPage) check should change to if (isLastPage && !isFirstPage)

compassalex avatar May 11 '22 15:05 compassalex

The same problem, despite the fact that I forcibly open the first page

seljmov avatar May 12 '22 05:05 seljmov

@enchev It's been fixed in 4.7.2

Cosmatevs avatar May 05 '23 09:05 Cosmatevs