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.9k stars 1.26k forks source link

MudDateRangePicker ResetAsync() does not affect the DateRange or the current focused period #9692

Open kellyrmartin opened 1 month ago

kellyrmartin commented 1 month ago

Things to check

Bug type

Component

Component name

MudDateRangePicker

What happened?

If you select a range from the previous year and then call ResetAsync() the focus of the control remains on the previously selected period. The DateRange is also unaffected

Expected behavior

The focused period should return to the current period and the DateRange should be cleared

Reproduction link

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

Reproduction steps

  1. Select a date range from 2021
  2. Click the button
  3. Date range and focused period in control are left unchanged

Relevant log output

No response

Version (bug)

7.6.0

Version (working)

No response

What browsers are you seeing the problem on?

Chrome

On which operating systems are you experiencing the issue?

macOS

Pull Request

Code of Conduct

vernou commented 1 month ago

Indeed, MudDateRangePicker.ResetAsync has a weird behavior. It resets MudDateRangePicker.Value... that isn't used by the component, because the real value is in MudDateRangePicker.DateRange.


@kellyrmartin, maybe MudDateRangePicker.ClearAsync can be a alternative. It resets MudDateRangePicker.DateRange.

kellyrmartin commented 1 week ago

That does in fact clear the date range but the focused period is left untouched