dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.36k stars 9.99k forks source link

InputCheckbox does not set initial value #8502

Closed we4sz closed 5 years ago

we4sz commented 5 years ago

Describe the bug

When creating a InputCheckbox where value is true the checkbox is still unchecked.

To Reproduce

Steps to reproduce the behavior:

  1. Create a simple component
    
    <EditForm Model="this">
    <h4>Checkbox</h4>
    <InputCheckbox bind-Value="@Visible"></InputCheckbox>
    </EditForm>

@functions{ [Parameter] protected bool Visible { get; set; } = true; }


### Expected behavior
The checkbox should be checked

### Additional context
```xml
<PackageReference Include="Microsoft.AspNetCore.Blazor" Version="0.9.0-preview3-19154-02" />
<PackageReference Include="Microsoft.AspNetCore.Blazor.Build" Version="0.9.0-preview3-19154-02" PrivateAssets="all" />
SteveSandersonMS commented 5 years ago

Thanks @we4sz for reporting this. It will be fixed in the next release.