Progress Bar does not update correctly

I created my own component which has a SfProgressBar inside. This simple component accepts a single double parameter as input, CompletionPercentage. I'd like to set the value of the progress bar to that value, while having also its color change based on the value.

Here's the complete code:

@using Syncfusion.Blazor.ProgressBar

<SfProgressBar Value="@CompletionPercentage" Minimum="0"
               Maximum="100" TrackThickness="20" ShowProgressValue="true"
               ProgressThickness="20" TrackColor="@TrackColorToUse" ProgressColor="@ProgressColorToUse">
</SfProgressBar>

@code {

    [Parameter]
    public double CompletionPercentage { get; set; }

    protected override void OnParametersSet()
    {
        base.OnParametersSet();
        StateHasChanged();
    }


    public string TrackColorToUse {
        get
        {
            if (CompletionPercentage <= 40.0)
            {
                return "#750F2A"; //red
            }
            else if (CompletionPercentage > 40.0 && CompletionPercentage < 100.0)
            {
                return "#D1A815"; //yellow
            }
            else
                return "#32B85A"; //green
        }
    }

    public string ProgressColorToUse
    {
        get
        {
            if (CompletionPercentage <= 40.0)
            {
                return "#9E1539"; //red
            }
            else if (CompletionPercentage > 40.0 && CompletionPercentage < 100.0)
            {
                return "#F5C518"; //yellow
            }
            else
                return "#42F577"; //green
        }
    }
}


As you can see, I have a property that returns a different color based on the value. The first time this progress bar is rendered everything is fine, but if I try to update the parameter in real time by giving a value that would trigger a different color, then the progress bar does not update accordingly: the color and the progress value are wrong.
Please note that the component is used inside a Sftab. If I switch tab to re-render the component manually, it works.
Thank you for your support.

3 Replies 1 reply marked as answer

SM Srihari Muthukaruppan Syncfusion Team January 14, 2021 12:12 PM UTC

Hi Luca, 
 
We have analyzed your query. Unfortunately, we are unable to reproduce the reported scenario in the latest version 18.4.34 at .NET5.0. We have also attached the sample used for testing for your reference and also attached the video link. Please find the sample and link below.  
 
 
Screenshot: 
 
 
If you still face this issue. kindly revert us with the following information which will be more helpful for further analysis and provide you the solution sooner.  
  
  1. Try to reproduce the reported scenario in the provided sample.  
  2. Else share the runnable project to check the reported scenario from our end.
 
Regards,   
Srihari 


Marked as answer

LU Luca January 15, 2021 08:40 AM UTC

Thank you for your support. After trying to replicate the issue on your example, I've discovered that this bug was fixed in some newer version of Syncfusion blazor. If I downgrade the version of your example, the issue occurs. I'm using 18.3.0.44 on .Net core 3.1. 
I will try to update to the latest version then.
Thank you, this issue can be closed. 


DG Durga Gopalakrishnan Syncfusion Team January 18, 2021 12:22 PM UTC

Hi Luca,

Thanks for an update. Please get back to us if you need any further assistance.

Regards,
Durga G


Loader.
Up arrow icon