Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MudDatePicker is not selecting date on first click

I have a form on a MudDialog that takes multiple dates and times from the user using MudDatePickers. I've found that upon adding the attribute PickerVariant="PickerVariant.Dialog" to them it now doesn't pick up the first value that is selected.

E.g. Upon opening the form I use the picker to select a date for the Start Date. Once selected the MudDatePicker closes but no text is displayed. If I go to the End Date MudDatePicker and select a date the text is updated immediately. Upon selecting the Start Date again I can see that the correct date is selected and finally it updates the text.

This is true no matter what is selected first or second.

Is this a known issue?? This was not an issue before adding the PickerVariant attribute so I can easily resolve this but I'd prefer to have the sleek look the PickerVariant.Dialog provides.

Made a VERY short version here that displays the same behaviour: https://try.mudblazor.com/snippet/mkGIkmOUdTexGCaK

like image 959
Lisa Avatar asked Nov 15 '25 22:11

Lisa


1 Answers

Seems there are multiple issues already raised for this/similar behaviour.

Might not be what you're after but it works when you remove the Mask on the DatePickers.

No mask in DatePickers

<MudDatePicker @ref="_startDatePicker" @bind-Date="startDate" Label="Start Date*" PickerVariant="PickerVariant.Dialog" Color="Color.Primary" Margin="Margin.Dense" Variant="Variant.Outlined" Editable="true" DisableToolbar="true" AutoClose="true" DateFormat="dd/MM/yyyy" MinDate="minDate" MaxDate="maxDate">
    <PickerActions>
        <MudButton Class="mr-auto align-self-start" OnClick="@(() => _startDatePicker.Clear())">Clear</MudButton>
        <MudButton OnClick="StartDateToday" Color="Color.Secondary">Today</MudButton>
    </PickerActions>
</MudDatePicker>
like image 59
RBee Avatar answered Nov 17 '25 20:11

RBee