OnValidSubmit for focus out events doesn't call handler

OnValidSubmit calls handler for textbox control when Enter key is used but doesn't call the handler when tabbing or click/touch away from textbox is done.

<SfInPlaceEditor

    @bind-Value="@exampleModel.TitleValue"

    Mode="RenderMode.Inline"

    ShowButtons="false"

    TValue="string"

    Name="Title"

    EmptyText="Enter your question title">

    <EditorComponent>

        <EditForm Model="@exampleModel" OnValidSubmit="ValidSubmit">

            <DataAnnotationsValidator />

            <SfTextBox @bind-Value="@exampleModel.TitleValue" Placeholder="Enter your question title"></SfTextBox>

            <ValidationMessage For=@(() => exampleModel.TitleValue)/>

        </EditForm>

    </EditorComponent>

</SfInPlaceEditor>


@code {

    private ExampleModel exampleModel = new ExampleModel();


    public class ExampleModel

    {

        [Required]

        [StringLength(10, ErrorMessage = "Enter Valid Ttile")]

        public string TitleValue = "Succinctly E-Book about TypeScript";

        [Required]

        [StringLength(100, ErrorMessage = "Enter Valid Comments")]

        public string CommentValue = "The extensive adoption of JavaScript for application development, and the ability to use HTML and JavaScript to create Windows Store apps, has made JavaScript a vital part of the Windows development ecosystem. Microsoft has done extensive work to make JavaScript easier to use.";

        [Required]

        [StringLength(100, ErrorMessage = "Enter Valid Tags")]

        public string[] TagValue = new string[] { "TS", "JS" };

    }


    private void ValidSubmit(EditContext context)

    {

        var ctx = context; // Code should execute OnValidSubmit

    }

}


1 Reply

VJ Vinitha Jeyakumar Syncfusion Team January 3, 2022 01:58 PM UTC

Hi Dave, 
 
 
We want to let you know that the onValidSubmit event callback will call only when we submit the values using submit button or enter key action. It won’t trigger when we focus out from the textbox. Even the native Blazor input components also behave in the same way. 
 
Please let us know if you have any concerns. 
 
Regards, 
Vinitha 


Loader.
Up arrow icon