fluentui-blazor
fluentui-blazor copied to clipboard
fix:FluentTextArea enter key valid EditForm
🐛 Bug Report
When FluentTextArea is used in EditForm when enter key is pressed EditForm is submitted
💻 Code Sample
<EditForm Model="@_current" OnValidSubmit="@ActionNewMailTemplate">
<BeSwarm.Validator.BlazorValidator ValidateContext="_validatorContext" />
<FluentTextField Label="Code" @bind-Value=_current.TemplateName></FluentTextField>
<ValidationMessage For="@(() => _current.TemplateName)" />
<FluentSwitch @bind-Value=_current.IsBodyHtml>Html</FluentSwitch>
<FluentTextField Label="Sujet" @bind-Value=_current.Subject></FluentTextField>
<ValidationMessage For="@(() => _current.Subject)" />
<FluentTextArea @bind-Value=_current.Body Placeholder="message ..."></FluentTextArea>
<ValidationMessage For="@(() => _current.Body)" />
<div>
<FluentButton Type="ButtonType.Submit" Appearance="Appearance.Accent "> Ajouter</FluentButton>
</div>
</EditForm>
@code
{
private async Task ActionNewMailTemplate()
{
....
}
}
ActionNewMailTemplate is called when enter key is pressed in FluentTextField
Is it possible to prevent this ?
Yes, remove the Type=ButtonType.Submit
part from the FluentButton
.
This is a workaround. We are looking for a bettter solution. I think this is related to #1050
In this case I no longer have editform validation.
Encountering this issue also - Removing the Submit button isn't great as we rely on that for its intended use. As in, we would lose other functionality we intend to keep.
See my additional comment in #1050. This is being caused by a bug in the underlying FAST script and can't be fixed until it is fixed there,