dotnetcore / BootstrapBlazor

Bootstrap Blazor is an enterprise-level UI component library based on Bootstrap and Blazor.
https://www.blazor.zone
Apache License 2.0
2.64k stars 301 forks source link

component DataProvider is never called #2653

Closed ntmessagebox closed 10 months ago

ntmessagebox commented 11 months ago

Is there an existing issue for this?

Describe the bug

Project created using Visual Studio 2022 Preview.

.NET ASPIRE SOLUTION -> .NET 8 Blazor Web App (Auto mode) with sample components

<Sidebar @ref="sidebar" IconName="IconName.BootstrapFill" Title="Blazor Bootstrap" DataProvider="SidebarDataProvider" />

@code {
    Sidebar sidebar;
    IEnumerable<NavItem> navItems;

    private async Task<SidebarDataProviderResult> SidebarDataProvider(SidebarDataProviderRequest request)
    {
        if (navItems is null)
            navItems = GetNavItems();

        return await Task.FromResult(request.ApplyTo(navItems));
    }

    private IEnumerable<NavItem> GetNavItems()
    {
        navItems = new List<NavItem>
        {
            new NavItem { Href = "/getting-started", IconName = IconName.HouseDoorFill, Text = "Getting Started"},
            new NavItem { Href = "/alerts", IconName = IconName.CheckCircleFill, Text = "Alerts"},
            new NavItem { Href = "/autocomplete", IconName = IconName.InputCursorText, Text = "Auto Complete"},
            new NavItem { Href = "/breadcrumb", IconName = IconName.SegmentedNav, Text = "Breadcrumb"},
            new NavItem { Href = "/sidebar", IconName = IconName.LayoutSidebarInset, Text = "Sidebar"},
        };
        return navItems;
    }
}

This code produce this result :

image

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

.NET 8

Anything else?

No response

bb-auto[bot] commented 11 months ago

@ntmessagebox Thank you for filing this issue. In order for us to investigate this issue, please provide a minimalistic repro project that illustrates the problem.

ntmessagebox commented 11 months ago

Minimalistic repo project : https://github.com/ntmessagebox/BootstrapAspire

(It's not using Render mode auto but it's not also not working)

ArgoZhang commented 10 months ago

@ntmessagebox Hi. We not provider any component named of Sidebar. I think you created an Issue in the wrong repo