Skip to content

bug(datepicker): Missing to announce the previous selection state on date, month and year #24086

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
zarend opened this issue Dec 10, 2021 · 2 comments
Labels
Accessibility This issue is related to accessibility (a11y) area: material/datepicker

Comments

@zarend
Copy link
Contributor

zarend commented Dec 10, 2021

Reproduction

Steps to reproduce:

  1. Open the Datepicker Examples
  2. Activate "Open calendar" button from any section, say, "Single date selection"
  3. Apply any date by selecting one from the datepicker
  4. Activate "Open the calendar" button again
  5. Focus on the previously selected date value

Expected Behavior

It should announce the previously selected date as "selected" when focus on it

Actual Behavior

It is not announcing the previously selected value state by the screen reader

Environment

OS| Browser | Screen reader
ChromeOS | Google Chrome 91.0.4472.167 | ChromeVox
macOS Catalina | Google Chrome 92.0.4515.131 | VoiceOver

Additional Notes

This is copied from an internal bug report found during a11y testing.

@zarend zarend added needs triage This issue needs to be triaged by the team Accessibility This issue is related to accessibility (a11y) area: material/datepicker and removed needs triage This issue needs to be triaged by the team labels Dec 10, 2021
zarend added a commit to zarend/components that referenced this issue Jan 14, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly angular#23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-selected="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes angular#23476, angular#24086
zarend added a commit to zarend/components that referenced this issue Jan 14, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly angular#23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes angular#23476, angular#24086
zarend added a commit to zarend/components that referenced this issue Jan 14, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly angular#23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes angular#23476, angular#24086
zarend added a commit to zarend/components that referenced this issue Jan 24, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly angular#23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes angular#23476, angular#24086
mmalerba pushed a commit that referenced this issue Jan 25, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly #23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes #23476, #24086
mmalerba pushed a commit that referenced this issue Jan 25, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly #23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes #23476, #24086

(cherry picked from commit 43db844)
mmalerba pushed a commit that referenced this issue Jan 25, 2022
Makes changes to the DOM structure of calendar cells for better screen reader experience. Previously, the DOM
structure looksed like this:

```
<!-- Existing DOM structure of each calendar body cell -->
<td
 class="mat-calendar-body-cell"
 role="gridcell"
 aria-disabled="false"
 aria-current="date"
 aria-selected="true"
 <!-- ... -->
>
 <!-- additional details ommited -->
</>
```

Using the `gridcell` role allows screenreaders to use table specific
navigation and some screenreaders would announce that the cells are
interactible because of the presence of `aria-selected`. However, some
screenreaders did not announce the cells as interactable and treated it
the same as a cell in a static table (e.g. VoiceOver announces element
type incorrectly #23476).

This changes the DOM structure to nest buttons
inside of a gridcell to make it more explicit that the table cells can
be interacted with and are not static content. The gridcell role is
still present, so table navigation will continue to work, but the
interaction is done with buttons nested inside the `td` elements.
The `td` element is only for adding information to the a11y tree and not used for visual purposes.

Updated DOM structure:

```
<td
  role="gridcell"
  class="mat-calendar-body-cell-container"
>
  <button
   class="mat-calendar-body-cell"
   aria-disabled="false"
   aria-current="date"
   aria-pressed="true"
   <!-- ... -->
  >
   <!-- additional details ommited -->
  </button>
</td>
```

Fixes #23476, #24086

(cherry picked from commit 43db844)
@zarend
Copy link
Contributor Author

zarend commented Feb 24, 2022

This was fixed by #24171

@zarend zarend closed this as completed Feb 24, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Accessibility This issue is related to accessibility (a11y) area: material/datepicker
Projects
None yet
Development

No branches or pull requests

1 participant