Skip to content

[Desktop][a11y] Date selection from DatePicker (Calendar Control) not working when Voiceover is enabled #121602

@aakashawalkar

Description

@aakashawalkar

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

  1. Create a flutter starter app & remove counter code

  2. Add an Elevated button in Scaffold

  3. Launch DatePicker upon Elevated Button click

  4. Turn ON Voiceover

  5. Navigate to the Elevated Button using Voiceover commands

  6. Open DatePicker by clicking Elevated Button

  7. Navigate through DatePicker using Voiceover commands

  8. Execute flutter run on the code sample

  9. ...

  10. ...

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!
Calendar.Control.Issue.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)a: desktopRunning on desktopf: material designflutter/packages/flutter/material repository.found in release: 3.7Found to occur in 3.7found in release: 3.9Found to occur in 3.9frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-macBuilding on or for macOS specificallyteam-macosOwned by the macOS platform teamtriaged-macosTriaged by the macOS platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions