Open tmonte opened 2 days ago
Thanks for contacting us. It looks like you're missing the form name attribute definition for your input element. Try it as follows:
<input type="text" @bind="CurrentValue" name="@NameAttributeValue" />
@guardrex can you please update the docs here to include the above property: https://learn.microsoft.com/aspnet/core/blazor/forms/binding?view=aspnetcore-8.0#input-component-based-on-inputbaset
Great, can confirm that fixes the issue.
@mkArtakMSFT ... This seems to only be a problem for statically-rendered components, so should the article section say that? ... OR should devs always place it because it has no effect interactively but allows the component to always run, regardless of its render mode?
I started the PR using the first idea for coverage at https://github.com/dotnet/AspNetCore.Docs/pull/34082. I'm 👂 if we'll be telling devs to always make that assignment.
BTW ... It's not important for this issue, but matching the method signature avoids the warning ...
protected override bool TryParseValueFromString(string? value, out string result, [NotNullWhen(false)] out string? validationErrorMessage)
@MackinnonBuck ... I pinged you on this PR as well ... https://github.com/dotnet/AspNetCore.Docs/pull/34082.
I need to know if (as the PR goes) we're only calling this out for static SSR. That seems to be the only time that adding name="@NameAttributeValue"
is required. If you want to tell devs to always add it, I'm 👂 for that change and will update the PR ASAP 🏃♂.
Is there an existing issue for this?
Describe the bug
Defining a custom "TextInput" component per docs:
Using it inside an EditForm
Result in logs is:
Am I missing anything in the Custom Input definition? I've also tried inheriting InputText directly, but had the same results. I couldn't find anything else in the docs.
Expected Behavior
Result in logs should be:
Steps To Reproduce
Exceptions (if any)
No response
.NET Version
8.0.403
Anything else?
No response