CodeBeamOrg / CodeBeam.MudBlazor.Extensions

Useful third party extension components for MudBlazor, from the contributors.
https://mudextensions.codebeam.org/
MIT License
367 stars 62 forks source link

MudWatch initial Value for the StopWatch not working #206

Closed Hiden46 closed 1 year ago

Hiden46 commented 1 year ago

I'm trying to set an initial value for the StopWatch function but it doesn't seem to work. The value is passed as an initial parameter when configuring the component.

<MudWatch @ref="watch" Mode="WatchMode.StopWatch" Value="@(new TimeSpan(1, 0, 0))" Wheel="false" ShowHour="true" ShowMinute="true" ShowSecond="true" ShowMillisecond="false" Typo="Typo.h6" />

The value is displayed only after a StateHasChanged() but when I start the MudWatch then it doesn't update the time.

mckaragoz commented 1 year ago

Should be fixed with next release.

But have a reminder for the usage, Value is two-way binded so you need to use

@bind-Value="_value"`
_value = new TimeSpan(1, 0, 0);

instead of Value="@(new TimeSpan(1, 0, 0))"