Skip to content

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

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

Merged
merged 1 commit into from
May 7, 2020

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Oct 5, 2019

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
Copy link
Member

jelbourn commented Oct 7, 2019

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

@crisbeto
Copy link
Member Author

crisbeto commented Oct 7, 2019

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
Copy link
Member

jelbourn commented Oct 8, 2019

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
Copy link
Contributor

Splaktar commented Nov 15, 2019

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
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
Copy link
Member Author

crisbeto commented May 3, 2020

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

@jelbourn
Copy link
Member

jelbourn commented May 4, 2020

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
Copy link
Member Author

crisbeto commented May 4, 2020

Done.

Copy link
Member

@jelbourn jelbourn left a comment

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

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

datepicker: double role definition in calendar-body.html
5 participants