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
}
}