-
-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
Describe the bug
When the following is rendered, the <a>
tag doesn't have an href attribute:
@page "/counter"
@using BlazorBootstrap
@inject HttpClient HttpClient;
<Button Type="@ButtonType.Link" To="/my-route" moo="moo">Moo</Button>
@code {
protected override async Task OnInitializedAsync()
{
await HttpClient.GetStringAsync("https://jsonplaceholder.typicode.com/posts/1");
}
}
If I remove the custom moo
attribute or comment out the HttpClient call in OnInitializedAsync
, then the button/link is rendered properly.
To Reproduce
Steps to reproduce the behavior:
- Add a Button with Type=ButtonType.Link and a URL for To and a custom HTML attribute
- Add an HttpClient call in OnInitializedAsync()
- Render the page
Expected behavior
Clicking the button should redirect to the URL specified in the To property.
Screenshots
If applicable, add screenshots to help explain your problem.
Versions (please complete the following information):
- .NET Version: .NET 9
- BlazorBootstrap: 3.4.0
- Blazor WebAssembly / Server: WebAssembly
- Blazor Interactive Render Mode: Auto
- Blazor Interactivity Location: Per page/component
Sample code
See above
GitHub repo
GitHub repo with minimal code to reproduce the issue.
Desktop (please complete the following information):
- OS: macOS, Windows
- Browser: Chrome
- Version: 140.0.7339.80
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
No labels