-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
When Voiceover is turned ON and the user launches DatePicker, the user is unable to navigate between calendar dates. This happens only when the starting dates (1, 2, 3, 4, 5, ...) of any month are disabled in the calendar.
Steps to Reproduce
-
Create a flutter starter app & remove counter code
-
Add an Elevated button in Scaffold
-
Launch DatePicker upon Elevated Button click
-
Turn ON Voiceover
-
Navigate to the Elevated Button using Voiceover commands
-
Open DatePicker by clicking Elevated Button
-
Navigate through DatePicker using Voiceover commands
-
Execute
flutter runon the code sample -
...
-
...
Expected results:
Even if a few dates are disabled, the user must be able to switch between calendar dates using DatePicker.
Actual results:
The user cannot use the voiceover command to move through calendar dates while the initial dates of any month are disabled.
Code sample
/// Date Picker Function: [openDatePicker] function is used display calendar
Future<DateTime?> openDatePicker({
DateTime? initialDate,
DateTime? firstDate,
DateTime? lastDate,
bool Function(DateTime)? selectableDayPredicate,
String? helpText,
}) {
final DateTime localInitialDate = initialDate ?? DateTime.now();
final DateTime localFirstDate = firstDate ?? DateTime.now();
final DateTime localLastDate = lastDate ??
DateTime(
DateTime.now().year, DateTime.now().month + 6, DateTime.now().day);
return showDatePicker(
context: context,
initialDatePickerMode: DatePickerMode.day,
initialEntryMode: DatePickerEntryMode.calendarOnly,
initialDate: localInitialDate,
firstDate: localFirstDate,
lastDate: localLastDate,
locale: kIsWeb
? Locale(window.locale.languageCode)
: Locale(Platform.localeName.split('_')[0]),
helpText: helpText,
selectableDayPredicate: selectableDayPredicate,
builder: (context, _) {
return Theme(
data: Theme.of(context).copyWith(
colorScheme: const ColorScheme.light(
primary: Colors.black87,
onPrimary: Colors.white,
),
),
child: _!,
);
},
);
}
Logs
Analyzing test-calendar-bug...
No issues found! (ran in 1.9s)
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.7.5, on macOS 13.1 22C65 darwin-x64, locale
en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version
33.0.0-rc1)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.3)
[✓] VS Code (version 1.75.1)
[✓] Connected device (2 available)
[✓] HTTP Host Availability
• No issues found!