-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Hello, it seem there is a problem when i use the parameter SelectedDate with the different events (for example ViewModeChanged).
to reproduce, update this part of your demo project
`Subscribe to events raised by the control.
<DatePicker Inline=true OnSelectedDateChanged=@changed OnSelected=@selected OnCleared=@cleared OnViewModeChanged="OnViewModeChanged" SelectedDate="@SelectedDateEvent" />
protected void OnViewModeChanged(NodaTimePicker.ViewMode mode)
{
Console.WriteLine("SelectedDateEvent" + SelectedDateEvent.ToString());
Console.WriteLine("viewmode changed " + mode.ToString());
StateHasChanged();
}
protected LocalDate? SelectedDateEvent { get; set; }
`
With this configuration, if you navigate to the year/month of the component and go to a different month/year than the initial SelectedDate (click on the month to open the list of monts and click on a different month), it always come back to the year/Month of the SelectedDate (because it hasn't changed yet).
I think you have to deal with two different date in your component to make this works together :
- a internal date used for navigation, not exposed
- the real selected Date
PS : a parameter InitialSelectedDate used only at startup can make the job too. With this, i can remove the SelectedDate parameter and works only for event. But i need initialized your component with a value different than today.
PS2 : i try also to activate your event OnMonthChanged but i have the same kind of behavior. The selectedDate not change so i always stuck on the mont/year of the selectedDate. Maybe thats why its not activated yet ?
Thanks !