MudBlazor / MudBlazor

Blazor Component Library based on Material design with an emphasis on ease of use. Mainly written in C# with Javascript kept to a bare minimum it empowers .NET developers to easily debug it if needed.
http://mudblazor.com
MIT License
7.56k stars 1.22k forks source link

Mask is not working with MudDateRangePicker #4933

Open mskorb opened 1 year ago

mskorb commented 1 year ago

Bug type

Component

Component name

MudDateRangePicker

What happened?

Component MudDateRangePicker has attribute Mask but setting it up does not work,

Expected behavior

I would like to add mask to MudDateRangePicker.

Reproduction link

https://try.mudblazor.com/snippet/GumcuBwbdpXglzjk

Reproduction steps

1 . Create editable DateRange <MudDateRangePicker Label="Basic range picker (editable)" Editable="true" @bind-DateRange="_dateRange" />

  1. Add mask <MudDateRangePicker Label="Basic range picker (editable)" Editable="true" @bind-DateRange="_dateRange" Mask="@(new DateMask("dd.MM.yyyy"))" />
  2. Mask is not working at all. I can type: 21.8.2022, and it is not changed to 21.08.2022

Relevant log output

No response

Version (bug)

newest

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On what operating system are you experiencing the issue?

Windows

Pull Request

Code of Conduct

dennml commented 1 year ago

I have found the same issue also.

When MudDatePicker is Editable, it is possible to define a Mask for the keyed value and that works great.

For MudDateRangePicker the Mask seems to be ignored and I can type any letters and numbers.

Please the following snippet to show that Mask works with MudDatePicker but not MudDateRangePicker https://try.mudblazor.com/snippet/mumckLmNbFliQmsm

NilkOne commented 1 year ago

Hi, same problem with Mask and MudDateRangePicker with MudBlazor 6.1.2

<MudDateRangePicker Label=@HomeExploitation_Strings.DateRange Editable="true" Mask="@(new DateMask("dd/MM/yyyy"))" DateFormat="dd/MM/yyyy" @bind-DateRange="_dateRange" />

image