Skip to content

fix(datepicker): double role definition on calendar cell - #17297

Merged
jelbourn merged 1 commit into
angular:masterfrom
crisbeto:17280/calendar-double-role
May 7, 2020
Merged

jelbourn merged 1 commit into
angular:masterfrom
crisbeto:17280/calendar-double-role

Conversation

@crisbeto

@crisbeto crisbeto commented Oct 5, 2019

Copy link
Copy Markdown
Member

Fixes the calendar cells having two role attributes.

Fixes #17280.

@crisbeto crisbeto added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful Accessibility This issue is related to accessibility (a11y) target: patch This PR is targeted for the next patch release labels Oct 5, 2019
@crisbeto
crisbeto requested a review from mmalerba as a code owner October 5, 2019 08:47
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 5, 2019
@jelbourn

jelbourn commented Oct 7, 2019

Copy link
Copy Markdown
Contributor

I'm not sure this is right; I think that we should have a button inside the gridcell.

@crisbeto

crisbeto commented Oct 7, 2019

Copy link
Copy Markdown
Member Author

I don't know how much of an effect that would have since focus lands on the td anyway. I think that if we make it land on the button the grid won't be read out anymore.

@jelbourn

jelbourn commented Oct 8, 2019

Copy link
Copy Markdown
Contributor

At the very least having a role="row" without a child gridcell is technically invalid and could make axe or Chrome a11y audit complain. I'll try to find some time this week to test both on VoiceOver and ChromeVox (and maybe NVDA and JAWS if I have even more time)

@jelbourn jelbourn added P2 The issue is important to a large percentage of users, with a workaround and removed P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful labels Oct 15, 2019
@Splaktar

Splaktar commented Nov 15, 2019 •

Copy link
Copy Markdown
Contributor

Based on the WAI-ARIA datepicker dialog example, it looks like we should indeed have buttons inside of the tds.

 <td class="dateCell">
    <button class="dateButton" tabindex="-1">2</button>
 </td>

Additionally, we put the role="presentation" on the table which doesn't align with the suggestion of using role="grid":

Since the grid role is applied to a table element, the row, colheader, and gridcell roles do not need to be specified because they are implied by tr, th, and td tags.

@Splaktar

Copy link
Copy Markdown
Contributor

I tested this change on NVDA 2019.2.1 and it's problematic (though not any worse than before this change). The behavior with NVDA was significantly better in Angular Material 7.x. I compare how things have regressed on NVDA here. NVDA has the same behavior with the change in this PR or without.

While #17280 mentions the duplicate roles, #17689 tracks the regression in screen reader support from 7.x to 8.2+.

@crisbeto
crisbeto force-pushed the 17280/calendar-double-role branch from 9ba50c0 to c9a17b9 Compare February 15, 2020 16:25
@crisbeto

crisbeto commented May 3, 2020

Copy link
Copy Markdown
Member Author

@jelbourn what should we do about this PR? We still have the duplicate roles in master.

@jelbourn

jelbourn commented May 4, 2020

Copy link
Copy Markdown
Contributor

I just tested this in ChromeVox, NVDA, and VoiceOver. NVDA does not work well with a button here, but all three work well with gridcell, so I believe we should just remove the button role.

Fixes the calendar cells having two `role` attributes.

Fixes angular#17280.
@crisbeto
crisbeto force-pushed the 17280/calendar-double-role branch from c9a17b9 to aeed2bb Compare May 4, 2020 21:05
@crisbeto

crisbeto commented May 4, 2020

Copy link
Copy Markdown
Member Author

Done.

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added lgtm action: merge The PR is ready for merge by the caretaker labels May 5, 2020
@jelbourn
jelbourn merged commit ec5f74c into angular:master May 7, 2020
jelbourn pushed a commit that referenced this pull request May 7, 2020
Fixes the calendar cells having two `role` attributes.

Fixes #17280.
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 Jun 7, 2020
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) action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release

5 participants