diff --git a/CHANGELOG.md b/CHANGELOG.md index c79798a3..55ffc59e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## [1.12.4] +* Default the `_selectedDay` state variable to be 1 when selecting the previous/next month from widget to ensure new date is valid for `_formatAsDateTime()` method (https://github.com/flutter/flutter/issues/123669 & https://github.com/macosui/macos_ui/pull/402) + ## [1.12.3] * Added support for `routerConfig` to `MacosApp.router`. ([#388](https://github.com/macosui/macos_ui/issues/388)) diff --git a/lib/src/selectors/date_picker.dart b/lib/src/selectors/date_picker.dart index f764394f..348fec85 100644 --- a/lib/src/selectors/date_picker.dart +++ b/lib/src/selectors/date_picker.dart @@ -354,9 +354,13 @@ class _MacosDatePickerState extends State { setState(() { _selectedYear--; _selectedMonth = 12; + _selectedDay = 1; }); } else { - setState(() => _selectedMonth--); + setState(() { + _selectedMonth--; + _selectedDay = 1; + }); } widget.onDateChanged.call(_formatAsDateTime()); }, @@ -397,9 +401,13 @@ class _MacosDatePickerState extends State { setState(() { _selectedYear++; _selectedMonth = 1; + _selectedDay = 1; }); } else { - setState(() => _selectedMonth++); + setState(() { + _selectedMonth++; + _selectedDay = 1; + }); } widget.onDateChanged.call(_formatAsDateTime()); diff --git a/pubspec.yaml b/pubspec.yaml index 7e1d73a1..40ee143e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: macos_ui description: Flutter widgets and themes implementing the current macOS design language. -version: 1.12.3 +version: 1.12.4 homepage: "https://macosui.dev" repository: "https://github.com/GroovinChip/macos_ui"