From 6d27aa0e906b8ed9b86db2426c20cdd3437e6ef5 Mon Sep 17 00:00:00 2001 From: albx Date: Tue, 4 Aug 2026 08:25:50 +0200 Subject: [PATCH 01/11] #95 - start implmentation of pagination changer --- .../Components/Pagination/BitPagination.razor | 10 + .../Pagination/BitPagination.razor.cs | 26 +++ .../BitPaginationTest.Rendering.razor | 196 ++++++++++++------ 3 files changed, 171 insertions(+), 61 deletions(-) diff --git a/src/BitBlazor/Components/Pagination/BitPagination.razor b/src/BitBlazor/Components/Pagination/BitPagination.razor index ab9c0ae..f919b7c 100644 --- a/src/BitBlazor/Components/Pagination/BitPagination.razor +++ b/src/BitBlazor/Components/Pagination/BitPagination.razor @@ -25,6 +25,16 @@ + @if (ShowChanger) + { + + @foreach (var pageSize in PageSizeOptions) + { + @pageSize + } + + } + @if (ShowJumpToPage) {
diff --git a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs index 822de15..327bfb0 100644 --- a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs +++ b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs @@ -168,6 +168,32 @@ public partial class BitPagination : BitComponentBase [Parameter] public Func? PageLinkGenerator { get; set; } + /// + /// Gets or sets a value indicating whether the page size changer is displayed in the pagination component. + /// + [Parameter] + public bool ShowChanger { get; set; } + + /// + /// Gets or sets the current page size, which determines how many items are displayed per page in the pagination component. + /// + [Parameter] + public int PageSize { get; set; } + + /// + /// Gets or sets the callback that is invoked when the page size changes. + /// + [Parameter] + public EventCallback PageSizeChanged { get; set; } + + /// + /// Gets or sets the collection of available page size options that users can select from in the pagination component. + /// + [Parameter] + public IEnumerable PageSizeOptions { get; set; } = []; + + private string ChangerActivatorLabel => $"{PageSize}"; + private string jumpToPageId = string.Empty; private string jumpToPageLabelClass = string.Empty; private string jumpToPageValue = string.Empty; diff --git a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor index c2c767c..7347613 100644 --- a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor +++ b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor @@ -11,26 +11,26 @@ @bind-Page="@currentPage" Description="Page navigation" />); - component.MarkupMatches( - @); + component.MarkupMatches( + @); } [Theory] @@ -47,26 +47,26 @@ Description="Page navigation" Alignment="alignment" />); - component.MarkupMatches( - @); + component.MarkupMatches( + @); } [Fact] @@ -76,9 +76,9 @@ var component = Render( @); + @bind-Page="currentPage" + Description="Page navigation" + Disabled="true" />); component.MarkupMatches( @
+ PageRangeSize="2" + ShowChanger="true" + PageSizeOptions="@(new[] { 10, 20, 30, 40 })" + @bind-PageSize="pageSize" + @bind-PageSize:after="HandlePageSizeChanged" /> } @code { [Parameter] public int Page { get; set; } = 1; + private const int DefaultPageSize = 10; private int currentPage; + private int pageSize = DefaultPageSize; private NewsResult? newsResult; private int totalPages; @@ -76,8 +83,19 @@ else protected override async Task OnInitializedAsync() { currentPage = Page < 1 ? 1 : Page; - newsResult = await NewsService.GetNewsAsync(currentPage); - totalPages = (int)Math.Ceiling((double)newsResult.TotalCount / 10); + await LoadPageAsync(); + } + + private async Task LoadPageAsync() + { + newsResult = await NewsService.GetNewsAsync(currentPage, pageSize); + totalPages = (int)Math.Ceiling((double)newsResult.TotalCount / pageSize); + } + + private async Task HandlePageSizeChanged() + { + currentPage = 1; + await LoadPageAsync(); } private static Color GetCategoryColor(string category) => category switch diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Pratiche.razor b/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Pratiche.razor index 3854733..14c9358 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Pratiche.razor +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/Pratiche.razor @@ -116,17 +116,22 @@ else Description="Navigazione pratiche" Alignment="PaginationAlignment.Center" PageRangeSize="2" - ShowJumpToPage="true"> + ShowJumpToPage="true" + ShowChanger="true" + PageSizeOptions="@(new[] { 8, 16, 24, 32 })" + @bind-PageSize="pageSize" + @bind-PageSize:after="HandlePageSizeChanged"> - Pratiche @((currentPage - 1) * PageSize + 1)–@(Math.Min(currentPage * PageSize, result.TotalCount)) di @result.TotalCount + Pratiche @((currentPage - 1) * pageSize + 1)–@(Math.Min(currentPage * pageSize, result.TotalCount)) di @result.TotalCount } @code { - private const int PageSize = 8; + private const int DefaultPageSize = 8; private int currentPage = 1; + private int pageSize = DefaultPageSize; private string? statoFiltroAttivo; private string? _activeToolbarItem; private PraticheResult? result; @@ -156,10 +161,16 @@ else await LoadPageAsync(); } + private async Task HandlePageSizeChanged() + { + currentPage = 1; + await LoadPageAsync(); + } + private async Task LoadPageAsync() { - result = await PraticheService.GetPraticheAsync(currentPage, statoFiltroAttivo); - totalPages = (int)Math.Ceiling((double)result.TotalCount / PageSize); + result = await PraticheService.GetPraticheAsync(currentPage, statoFiltroAttivo, pageSize); + totalPages = (int)Math.Ceiling((double)result.TotalCount / pageSize); } private static Color GetStatoColor(string stato) => stato switch diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/INewsService.cs b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/INewsService.cs index 1ef8fee..a6c0665 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/INewsService.cs +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/INewsService.cs @@ -4,5 +4,5 @@ namespace BitBlazor.Sample.Services; public interface INewsService { - Task GetNewsAsync(int page); + Task GetNewsAsync(int page, int pageSize = 10); } diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/IPraticheService.cs b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/IPraticheService.cs index 6095d89..ef63a67 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/IPraticheService.cs +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/IPraticheService.cs @@ -4,5 +4,5 @@ namespace BitBlazor.Sample.Services; public interface IPraticheService { - Task GetPraticheAsync(int page, string? statoFiltro = null); + Task GetPraticheAsync(int page, string? statoFiltro = null, int pageSize = 8); } diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/NewsService.cs b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/NewsService.cs index 7f584e2..27c3c40 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/NewsService.cs +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/NewsService.cs @@ -4,7 +4,6 @@ namespace BitBlazor.Sample.Services; public class NewsService : INewsService { - private const int PageSize = 10; private const int TotalItems = 50; private static readonly string[] Categories = @@ -30,10 +29,10 @@ public class NewsService : INewsService "Il Comune di Bitopoli aderisce al programma nazionale per la rigenerazione urbana dei quartieri periferici." ]; - public Task GetNewsAsync(int page) + public Task GetNewsAsync(int page, int pageSize = 10) { - var skip = (page - 1) * PageSize; - var count = Math.Min(PageSize, TotalItems - skip); + var skip = (page - 1) * pageSize; + var count = Math.Min(pageSize, TotalItems - skip); var items = Enumerable.Range(skip + 1, count) .Select(i => new NewsItem( diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/PraticheService.cs b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/PraticheService.cs index 75bcecf..231a5f1 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Services/PraticheService.cs +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Services/PraticheService.cs @@ -4,8 +4,6 @@ namespace BitBlazor.Sample.Services; public class PraticheService : IPraticheService { - private const int PageSize = 8; - private static readonly IReadOnlyList AllPratiche = [ new(1, "Rinnovo Carta d'Identità Elettronica", "Anagrafe", "Completata", "Richiesta di rinnovo della CIE scaduta. Documento ritirato allo sportello.", new DateOnly(2025, 11, 3)), @@ -40,15 +38,15 @@ public class PraticheService : IPraticheService new(30, "Rettifica Atto di Nascita", "Anagrafe", "In Lavorazione", "Istanza di rettifica per errore materiale in trascrizione atto di nascita. Pratiche in corso.", new DateOnly(2026, 4, 9)), ]; - public Task GetPraticheAsync(int page, string? statoFiltro = null) + public Task GetPraticheAsync(int page, string? statoFiltro = null, int pageSize = 8) { var filtered = string.IsNullOrEmpty(statoFiltro) ? AllPratiche : AllPratiche.Where(p => p.Stato == statoFiltro).ToList(); var items = filtered - .Skip((page - 1) * PageSize) - .Take(PageSize) + .Skip((page - 1) * pageSize) + .Take(pageSize) .ToList(); return Task.FromResult(new PraticheResult(items, filtered.Count)); From d8d400599854c60b1231f810bae42f3ed6b57dac Mon Sep 17 00:00:00 2001 From: albx Date: Mon, 17 Aug 2026 07:59:57 +0200 Subject: [PATCH 06/11] #95 - document the interactivity requirement for BitDropdown. remove page changer from news page on sample since it's SSR page --- docs/components/dropdown.md | 2 ++ docs/components/pagination.md | 10 +++++++--- .../Components/Pages/News.razor | 17 +++-------------- .../Components/Dropdown/BitDropdown.razor.cs | 7 +++++++ .../Pagination/BitPagination.razor.cs | 6 ++++++ 5 files changed, 25 insertions(+), 17 deletions(-) diff --git a/docs/components/dropdown.md b/docs/components/dropdown.md index faa570a..9192fac 100644 --- a/docs/components/dropdown.md +++ b/docs/components/dropdown.md @@ -14,6 +14,8 @@ BitBlazor.Components A custom `ActivatorTemplate` can replace the built-in toggle button with any element while retaining the complete keyboard interaction model. +> **Requires interactive rendering.** Because the open/closed state is managed purely in C# (`@onclick` / `@onkeydown`) with no JavaScript fallback, `BitDropdown` only works under an interactive render mode (Server, WebAssembly, or Auto). Under static SSR the activator button cannot be toggled, so the menu can never open — even though `BitDropdownItem.Href` values still render as valid links. This also applies to any component that renders a `BitDropdown` internally, such as `BitPagination`'s `ShowChanger` feature (see [pagination.md](./pagination.md)). + ## Components | Component | Description | diff --git a/docs/components/pagination.md b/docs/components/pagination.md index c125619..89d558b 100644 --- a/docs/components/pagination.md +++ b/docs/components/pagination.md @@ -12,7 +12,9 @@ BitBlazor.Components The Pagination component enables users to navigate through large data sets split across multiple pages. It renders previous/next buttons, individual page links with optional ellipsis truncation, and optional extras such as a jump-to-page input and a total-items summary. Two view modes are available: the default full control and a compact simple mode. -`BitPagination` supports both **interactive** and **static SSR** render modes. In interactive mode, page changes are handled via two-way binding with `@bind-Page`. In SSR mode, supply a `PageLinkGenerator` to render real `` links that trigger full browser navigation — no JavaScript required. +`BitPagination` supports both **interactive** and **static SSR** render modes for page navigation. In interactive mode, page changes are handled via two-way binding with `@bind-Page`. In SSR mode, supply a `PageLinkGenerator` to render real `` links that trigger full browser navigation — no JavaScript required. + +> **The page size changer (`ShowChanger`) requires interactive rendering.** It is rendered with [`BitDropdown`](./dropdown.md), which manages its open/closed state entirely in C# with no href-based fallback. Setting `PageLinkGenerator` produces valid links for each page size option, but the dropdown menu itself cannot be opened under static SSR — it needs an interactive render mode (Server, WebAssembly, or Auto). ## Parameters @@ -311,6 +313,8 @@ When `PageRangeSize` is set, only the first page, the last page, the current pag ### SSR with page size changer +> **Note:** This example only works if the page is rendered with an interactive render mode. The `PageLinkGenerator` produces valid `` links for each page size option, but the changer's dropdown menu (`BitDropdown`) cannot be opened under fully static SSR — see the [BitDropdown render mode requirements](./dropdown.md). + When using SSR mode with `PageLinkGenerator`, the page size changes are also included in the URL: ```razor @@ -514,8 +518,8 @@ When `PageLinkGenerator` is set, each `href` is populated with the URL returned - The `PageSize` parameter supports two-way binding via `@bind-PageSize`. Use `@bind-PageSize:after` to react to page size changes (e.g. to reload data with the new page size). - When `ShowJumpToPage` is `true` and the user enters a value outside the valid range (`< 1` or `> NumberOfPages`), the input is silently reset without triggering navigation. - `PageRangeSize` always preserves the first and last page buttons; only the middle pages are collapsed into ellipses. -- **Page size changer**: When `ShowChanger` is `true`, a dropdown menu is rendered allowing users to select from `PageSizeOptions`. Set `ChangerId` to assign a custom identifier to the dropdown button for accessibility. Set `PageSizeLabelTemplate` to customize how page sizes are displayed in the dropdown. -- **SSR compatibility**: In Blazor static SSR, `@onclick` C# callbacks never fire. Set `PageLinkGenerator` to produce real `` links — the component will then work purely via browser navigation with no JavaScript required. The `PageLinkGenerator` receives the entire `PaginationState` (including both page number and page size), allowing you to encode both into the URL. +- **Page size changer**: When `ShowChanger` is `true`, a dropdown menu is rendered allowing users to select from `PageSizeOptions`. Set `ChangerId` to assign a custom identifier to the dropdown button for accessibility. Set `PageSizeLabelTemplate` to customize how page sizes are displayed in the dropdown. **This feature requires an interactive render mode** — it is rendered with `BitDropdown`, which has no static-SSR fallback for opening the menu (see [BitDropdown render mode requirements](./dropdown.md)). +- **SSR compatibility**: In Blazor static SSR, `@onclick` C# callbacks never fire. Set `PageLinkGenerator` to produce real `` links — the component will then work purely via browser navigation with no JavaScript required for page navigation. This does **not** extend to the page size changer (`ShowChanger`), which still requires an interactive render mode. The `PageLinkGenerator` receives the entire `PaginationState` (including both page number and page size), allowing you to encode both into the URL. - **Progressive enhancement**: When both `PageLinkGenerator` and `@bind-Page` (or `@bind-PageSize`) are set, the component uses `@onclick:preventDefault` to intercept clicks in interactive mode (running the C# handler) while still exposing a valid `href` for SSR and for right-click / open-in-new-tab scenarios. - **Disabled nav buttons**: The previous-page button on page 1 and the next-page button on the last page are automatically disabled — they receive the `disabled` CSS class on `
  • `, plus `aria-hidden="true"` and `tabindex="-1"` on the ``, regardless of the `Disabled` parameter. When `PageLinkGenerator` is set, these boundary buttons render without an `href` since there is no valid target page to link to. diff --git a/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/News.razor b/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/News.razor index 31841eb..84e2993 100644 --- a/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/News.razor +++ b/samples/BitBlazor.Sample/BitBlazor.Sample/Components/Pages/News.razor @@ -57,11 +57,7 @@ else PageLinkGenerator="@(state => $"/news/{state.CurrentPage}")" Description="Navigazione notizie" Alignment="PaginationAlignment.Center" - PageRangeSize="2" - ShowChanger="true" - PageSizeOptions="@(new[] { 10, 20, 30, 40 })" - @bind-PageSize="pageSize" - @bind-PageSize:after="HandlePageSizeChanged" /> + PageRangeSize="2" /> } @code { @@ -70,7 +66,6 @@ else private const int DefaultPageSize = 10; private int currentPage; - private int pageSize = DefaultPageSize; private NewsResult? newsResult; private int totalPages; @@ -88,14 +83,8 @@ else private async Task LoadPageAsync() { - newsResult = await NewsService.GetNewsAsync(currentPage, pageSize); - totalPages = (int)Math.Ceiling((double)newsResult.TotalCount / pageSize); - } - - private async Task HandlePageSizeChanged() - { - currentPage = 1; - await LoadPageAsync(); + newsResult = await NewsService.GetNewsAsync(currentPage, DefaultPageSize); + totalPages = (int)Math.Ceiling((double)newsResult.TotalCount / DefaultPageSize); } private static Color GetCategoryColor(string category) => category switch diff --git a/src/BitBlazor/Components/Dropdown/BitDropdown.razor.cs b/src/BitBlazor/Components/Dropdown/BitDropdown.razor.cs index ff4808f..1c70472 100644 --- a/src/BitBlazor/Components/Dropdown/BitDropdown.razor.cs +++ b/src/BitBlazor/Components/Dropdown/BitDropdown.razor.cs @@ -6,6 +6,13 @@ namespace BitBlazor.Components; /// /// Represents a dropdown component that can be used to display a list of options or actions in a collapsible menu. /// +/// +/// Requires an interactive render mode (Server, WebAssembly, or Auto). The open/closed state and keyboard +/// navigation are managed entirely in C# via event handlers, with no JavaScript interop and no href-based +/// fallback for the activator button. Under static SSR (no circuit/WASM runtime attached) the activator +/// cannot be toggled, so the menu can never be opened. Do not use — directly or +/// indirectly, e.g. via — on a page that stays fully static. +/// public partial class BitDropdown : BitComponentBase { /// diff --git a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs index 10806d7..0e70779 100644 --- a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs +++ b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs @@ -171,6 +171,12 @@ public partial class BitPagination : BitComponentBase /// /// Gets or sets a value indicating whether the page size changer is displayed in the pagination component. /// + /// + /// The changer is rendered with , which requires an interactive render mode + /// (Server, WebAssembly, or Auto) to open and close. Unlike page navigation, it has no href-based fallback, + /// so setting does not make the changer usable under static SSR — the + /// dropdown menu simply cannot be opened without a live circuit or WASM runtime. + /// [Parameter] public bool ShowChanger { get; set; } From e323d604d1d97608c97c2f2cff3c38b2f6bc6450 Mon Sep 17 00:00:00 2001 From: albx Date: Mon, 17 Aug 2026 08:33:46 +0200 Subject: [PATCH 07/11] #95 - add changer aria-label parameter --- .../Components/Pagination/BitPagination.razor | 4 +- .../Pagination/BitPagination.razor.cs | 20 +++++++- .../Pagination/BitPaginationTest.Behaviors.cs | 51 +++++++++++++++++++ .../BitPaginationTest.Rendering.razor | 4 +- 4 files changed, 74 insertions(+), 5 deletions(-) diff --git a/src/BitBlazor/Components/Pagination/BitPagination.razor b/src/BitBlazor/Components/Pagination/BitPagination.razor index 10b530c..e97de73 100644 --- a/src/BitBlazor/Components/Pagination/BitPagination.razor +++ b/src/BitBlazor/Components/Pagination/BitPagination.razor @@ -27,9 +27,9 @@ @if (ShowChanger) { - + - diff --git a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs index 0e70779..8ca958d 100644 --- a/src/BitBlazor/Components/Pagination/BitPagination.razor.cs +++ b/src/BitBlazor/Components/Pagination/BitPagination.razor.cs @@ -204,6 +204,12 @@ public partial class BitPagination : BitComponentBase [Parameter] public string ChangerId { get; set; } = string.Empty; + /// + /// Gets or sets the accessible label for the page size changer button. The default value is "Select page size". + /// + [Parameter] + public string ChangerAriaLabel { get; set; } = "Select page size"; + /// /// Gets or sets the template used to render the label for the page size changer, allowing for customization of how the page size is displayed. /// @@ -212,7 +218,19 @@ public partial class BitPagination : BitComponentBase private Func PageSizeDefaultLabel => (pageSize) => $"{pageSize}"; - private string ChangerComputedId => !string.IsNullOrWhiteSpace(ChangerId) ? ChangerId : $"pageSizeChanger-{Guid.NewGuid():N}"; + private string _changerComputedId = string.Empty; + + private string GetChangerComputedId() + { + if (string.IsNullOrWhiteSpace(_changerComputedId)) + { + _changerComputedId = !string.IsNullOrWhiteSpace(ChangerId) + ? ChangerId + : $"pageSizeChanger-{Guid.NewGuid():N}"; + } + + return _changerComputedId; + } private string jumpToPageId = string.Empty; private string jumpToPageLabelClass = string.Empty; diff --git a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Behaviors.cs b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Behaviors.cs index a0df8bc..3eff476 100644 --- a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Behaviors.cs +++ b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Behaviors.cs @@ -250,4 +250,55 @@ public void BitPagination_Should_Change_PageSize_Correctly_When_PageSize_Changed Assert.Equal(20, pageSize); } + + [Fact] + public void BitPagination_Should_Set_AriaLabel_On_Changer_Button() + { + using var ctx = new BunitContext(); + ctx.SetRendererInfo(new RendererInfo("InteractiveServer", isInteractive: true)); + + int pageSize = 10; + int[] pageSizeOptions = [10, 20, 30]; + + var component = ctx.Render( + parameters => parameters + .Add(p => p.NumberOfPages, 3) + .Add(p => p.Description, "pagination") + .Add(p => p.ShowChanger, true) + .Add(p => p.PageSizeOptions, pageSizeOptions) + .Add(p => p.ChangerAriaLabel, "Rows per page") + .Bind(p => p.PageSize, pageSize, v => pageSize = v)); + + var changerButton = component.Find("button.btn-dropdown"); + + Assert.Equal("Rows per page", changerButton.GetAttribute("aria-label")); + } + + [Fact] + public void BitPagination_Should_Keep_Changer_Id_Stable_Across_Renders() + { + using var ctx = new BunitContext(); + ctx.SetRendererInfo(new RendererInfo("InteractiveServer", isInteractive: true)); + + int page = 1; + int pageSize = 10; + int[] pageSizeOptions = [10, 20, 30]; + + var component = ctx.Render( + parameters => parameters + .Add(p => p.NumberOfPages, 3) + .Add(p => p.Description, "pagination") + .Add(p => p.ShowChanger, true) + .Add(p => p.PageSizeOptions, pageSizeOptions) + .Bind(p => p.Page, page, v => page = v) + .Bind(p => p.PageSize, pageSize, v => pageSize = v)); + + var firstId = component.Find("button.btn-dropdown").GetAttribute("id"); + + component.Render(); + + var secondId = component.Find("button.btn-dropdown").GetAttribute("id"); + + Assert.Equal(firstId, secondId); + } } diff --git a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor index 4872ed1..ad5528e 100644 --- a/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor +++ b/tests/BitBlazor.Test/Components/Pagination/BitPaginationTest.Rendering.razor @@ -425,7 +425,7 @@