Skip to content

Double click on Confirm Dialog option raise an error #1264

@abidalis

Description

@abidalis

NOTE: We do not look at .zip attachments for issue investigation.

Describe the bug
Double click on Confirm Dialog option (Yes/No) raise an error System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.

To Reproduce
Steps to reproduce the behavior:

  1. Use Confirm Dialog on page.
  2. Double click very fast on any option (Yes/No)
  3. Raise error System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.

NOTE: We are using CustomErrorBoundary to catch exception in any page.

Expected behavior
It should handle double click by disabling the option button after single click or considering it as a single click only.

Stack trace
An unhandled exception occurred.
System.InvalidOperationException: An attempt was made to transition a task to a final state when it had already completed.
at System.Threading.Tasks.TaskCompletionSource`1.SetResult(TResult result)
at BlazorBootstrap.ConfirmDialog.OnYesClick()
at Microsoft.AspNetCore.Components.EventCallbackWorkItem.InvokeAsync[T](MulticastDelegate delegate, T arg)
at Microsoft.AspNetCore.Components.ComponentBase.Microsoft.AspNetCore.Components.IHandleEvent.HandleEventAsync(EventCallbackWorkItem callback, Object arg)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.DispatchEventAsync(UInt64 eventHandlerId, EventFieldInfo fieldInfo, EventArgs eventArgs, Boolean waitForQuiescence)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions