Closed Andrioden closed 3 years ago
Thanks for contacting us. Thread.Sleep
results in the UI thread being blocked. Try to use the async alternative of await Task.Delay(3000)
. That should do it.
This issue has been resolved and has not had any activity for 1 day. It will be closed for housekeeping purposes.
See our Issue Management Policies for more information.
Describe the bug
See the complete blazor (.razor file) code below that recreates the problem as simple as possible. I want the
State
value to update as the HandleValidSubmit is processing, here faked by aThread.Sleep
. If you run the code and click the submit button you will see that in the browser that the value goes from1 -> 3,
and not1 -> 2 -> (sleep 2seconds) -> 3
To Reproduce
Exceptions (if any)
None
Further technical details
dotnet --info output