spinner is not disappearing after function is executed

Hello,

i already contacted the support but couldn't receive any help yet so Im trying here. I have a page which can receive a csv file and load the data into our database. While the data is being loaded a ShowSpinner() function is called to show the user that something is loading or processing. At the end of the function another function called HideSpinner() is called so the spinner gets removed at the end. The problem is it does not get removed!

Here is the source code:

spinner_forum.PNG

A quick WriteLine shows that the variable spinner_visibility does get set to false but it doesnt affect the spinner. The strange thing is that the spinner appears to behave normally once you use it in other ways such as clicking a button to manually call hide- or showspinner.

I would be glad for any help.


1 Reply

VJ Vinitha Jeyakumar Syncfusion Team August 25, 2022 12:03 PM UTC

Hi Jasin,


Instead of calling showSpinner and hideSpinner method to make the spinner visible and hide, please try to use the Visible property directly where you want to show and hide the spinner. please check the code below,

Code snippet:
<div><SfButton @onclick="@ClickHandler">Show/Hide Spinner</SfButton><div id="container"><SfSpinner @bind-Visible="@VisibleProperty"></SfSpinner></div></div>

@code{
    private bool VisibleProperty { get; set; } = false;

    private async Task ClickHandler()
    {
        this.VisibleProperty = true;
        await Task.Delay(2000);
        this.VisibleProperty = false;
    }
}


If still issue not resolved at your end, please followup on this issue using the support ticket you have created.

Regards,
Vinitha

Loader.
Up arrow icon