I wanted to create a custom timepickercomponent and use it everywhere in my app where i use a MudTimePicker. This, because that way I can easily configure AutoClose=false everywhere, and in the future maybe also other custom options.
<MudDatePicker @bind-Date="@deletedDate" Label="Delete Date" />
<MudTimePicker @bind-Time="@deletedTime" Label="Delete Time"/>
<TimePickerComponent @bind-TimeValue="@deletedTime" Label="Delete Time From Custom Component"/>
@code{
public DateTime? deletedDate { get; set; }
public TimeSpan? deletedTime { get; set; }
}
However, the parent component seems to be unable to show the time i’ve picked in my mudtimepicker component. I created a mudblazor snippet here: https://try.mudblazor.com/snippet/cYmIuiYpzoGHegIi .
I have tried MudBlazor 7.4 and 7.5 packages, they both show the same behavior.
I have also tried defining an OnOkButtonClicked function where I invoke the TimeValueChanged async. However, this also does not seem to be working.
private void OnOkButtonClicked()
{
TimeValueChanged.InvokeAsync();
_picker.CloseAsync();
}
Thank you,
Natasja Wezel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.