Hi Oliver,
Greetings from Syncfusion support,
Query: “My issue is everytime I submit using the ENTER KEY the SfDialog @ref="Duplicates" will open even if the data submitted is valid. The weird thing is clicking the submit button does not have this issue. Only by pressing the ENTER KEY this issue will arise.”
We have validated your reported query. We couldn’t make a runnable sample, using the shared code blocks. Based on the shared information, you can prevent the dialog (SfDialog @ref="Duplicates") from being opened if it is valid in the OnOpen DialogEvent of the dialog. Check the below code blocs for reference.
<SfDialog @ref=”@Duplicates” Width="350px" @bind-Visible="@IsVisible" ShowCloseIcon="true" IsModal="true">
<DialogEvents OnOpen="@onOpen"></DialogEvents>
</SfDialog>
@code {
public void onOpen(BeforeOpenEventArgs args)
{
// Prevent dialog from being opened.
args.Cancel = true;
}
}
|
Please let us know if the solution helps,
If the above requirement doesn’t meet your requirements, can you please share us the following details ?
- If possible, can you please replicate the issue in a sample and revert back to us ?
- Can you please, share us the issue reproducing steps. if any, for reproducing the reported issue from our end ?
Regards,
Indrajith