MudBlazor/MudBlazor

MudForm.IsValid Defaults to `false` with Required Fields

Chiusa

#5196 aperta il 1 set 2022

 (9 commenti) (3 reazioni) (0 assegnatari)C# (1631 fork)batch import
bughas workaroundhelp wanted

Metriche repository

Star
 (10.394 stelle)
Metriche merge PR
 (Merge medio 6g 6h) (108 PR mergiate in 30 g)

Descrizione

Bug type

Component

Component name

mudForm

What happened?

<MudForm Model="@_model" @ref="@_form" @bind-IsValid="@_success" Validation="@(_loginValidator.ValidateValue)"> .... @{ bool _success=true; } when mudform initialize not any change, I think this "_success" should not be change. right? but actually, the _success value always change to false, even _loginValidator return vaild( not any errors)

Expected behavior

I think IsValid does not change when mudform initializes.

Reproduction link

https://try.mudblazor.com/snippet/mamGEtEFuJcosnnE

Reproduction steps

<MudTextField @bind-Value="model.Name"
For="@(() => model.Name)" Immediate="true" Required="true" Label="Name" />

when Required="true", even default set value. ...

Relevant log output

No response

Version (bug)

6.xxx

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On what operating system are you experiencing the issue?

Windows

Pull Request

  • I would like to do a Pull Request

Code of Conduct

  • I agree to follow this project's Code of Conduct

Guida contributor