Blazor

Why does Blazor InputCheckbox not set an initial value?

Why does Blazor InputCheckbox not set an initial value?

This issue is resolved in the Balzor 3.0.0 Preview 5 version.

<EditForm Model="this">
    <h4>Checkbox</h4>
    <InputCheckbox @bind-Value="@Visible"></InputCheckbox>
</EditForm>
@code {
    [Parameter]
    public bool Visible { get; set; } = true;
}

I would suggest you check the below link for better understanding:
https://github.com/aspnet/AspNetCore/issues/8502

 

Sumitra Kumari Shaw

An Engineering graduate who Enjoys building things that live on the internet.