Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix:FluentTextArea enter key valid EditForm #1085

Open
be-swarm opened this issue Dec 7, 2023 · 4 comments
Open

fix:FluentTextArea enter key valid EditForm #1085

be-swarm opened this issue Dec 7, 2023 · 4 comments
Labels
area:fast A FAST-specific issue bug A bug status:blocked Any issue blocked by another

Comments

@be-swarm
Copy link

be-swarm commented Dec 7, 2023

馃悰 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 ?

@vnbaaij
Copy link
Collaborator

vnbaaij commented Dec 7, 2023

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

@be-swarm
Copy link
Author

be-swarm commented Dec 7, 2023

In this case I no longer have editform validation.

@pingu2k4
Copy link

pingu2k4 commented Dec 7, 2023

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.

@vnbaaij
Copy link
Collaborator

vnbaaij commented Dec 8, 2023

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,

@vnbaaij vnbaaij added bug A bug area:fast-blazor status:blocked Any issue blocked by another area:fast A FAST-specific issue and removed area:fast-blazor labels Dec 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:fast A FAST-specific issue bug A bug status:blocked Any issue blocked by another
Projects
None yet
Development

No branches or pull requests

3 participants