-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue
Milestone
Description
Describe the bug
When the EditForm component binds through the Model property, accessing the EditContext property returns null. Why not return the _fixedEditContext?
To Reproduce
I have a component with this EditForm:
<EditForm @ref="editForm"
OnValidSubmit="@Submit"
Model="@Customer">
In its @code I have this:
private EditForm editForm;
private bool isInvalid = false;
protected override void OnInit()
{
if( editForm?.EditContext == null)
{
Console.WriteLine("??? EditContext is null???");
} else
{
isInvalid = editForm.EditContext.Validate();
}
Expected behavior
I would expect that EditContext has a value, even though not set myself.
Additional context
This is on Blazor Preview 6
ryanelian, pwinstead and YannikBartel
Metadata
Metadata
Assignees
Labels
DoneThis issue has been fixedThis issue has been fixedarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing onehelp wantedUp for grabs. We would accept a PR to help resolve this issueUp for grabs. We would accept a PR to help resolve this issue