Issue using ConfirmDialog and Toasts alongside EditForm #913
Unanswered
visuallimo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello. Good morning. I hope you can help me.
I am trying to use the ConfirmDialog and Toasts components.
If I run it from any component, it works perfectly:
Example:
The problem occurs when I use EditForm, as neither ConfirmDialog nor Toasts become visible, despite being invoked. When you click the save button, the browser remains "loading."
Example Code:
@page "/prueba"
<ConfirmDialog @ref="dialog" />
@code {
private ConfirmDialog dialog = default!;
private Cliente Model = new Cliente();
private async Task HandleSubmit(EditContext context)
{
try
{
if (context.Validate())
{
var confirmation = await ShowConfirmation();
if (confirmation)
{
await Insert(Model);
}
}
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
Beta Was this translation helpful? Give feedback.
All reactions