material-components / material-components/material-components-android

[MaterialDatePicker] Talkback does not announce initially selected date as "selected"

Open
#3,552 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Issue: Accessibility Widget: DatePicker
Dominant language
Java
Stars
17.4k
Forks
3.2k
PR merge metrics
No merged PRs in 30d

Description

Description: An initially selected date (e.g., a date set using MaterialDatePickerBuilder.datePicker().setSelection()) is not announced as "selected" when using Talkback. It is necessary for the user to interactively select a date at which point "selected" will be prepended to the announcement of the date. After that, Talkback will correctly announce the selected date.

- Expected behavior: Regardless of whether the date is initially selected or interactively selected, Talkback should announce "selected" when swiping to the selected date.

- Source code:

Add the following to an Activity's "onCreate" to build and show a date picker dialog :

var datePicker = MaterialDatePicker.Builder.datePicker().setSelection(Date().time).build()
.show(supportFragmentManager,"")

Note that when initially swiping to the selected date, it will not be announced as selected (see attached video).

- Android API version: 34

- Device: Pixel 5

- Material Library Version : com.google.android.material:material:1.9.0

https://github.com/material-components/material-components-android/assets/26826628/7a31c145-97e1-4a65-a354-473404d6dd6a

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue using MaterialDatePicker.Builder.datePicker().setSelection(Date().time) on Android API 34 with TalkBack enabled. Trace the MaterialDatePicker date-selection accessibility behavior, then verify that an initially selected date is announced as selected and that interactive selection remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
accessibility, mobile
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.