Skip to content

Calendar: add ARIA labels#1476

Merged
MLoughry merged 12 commits intomicrosoft:masterfrom
MLoughry:calendar/add-aria-labels
Apr 20, 2017
Merged

Calendar: add ARIA labels#1476
MLoughry merged 12 commits intomicrosoft:masterfrom
MLoughry:calendar/add-aria-labels

Conversation

@MLoughry
Copy link
Contributor

Pull request checklist

Description of changes

This change adds ARIA labels to day and month buttons within the Calendar component, using toLocaleString.

Focus areas to test

(optional)

@micahgodbolt
Copy link
Member

This looks fine to me. Any other aria gurus we should ping about this? Or pretty straight forward.

@micahgodbolt
Copy link
Member

Hey @vibhava, does this look correct to you?

@cschlechty
Copy link
Member

ARIA looks fine. Can we also fix where we're using clickable spans and not true buttons while touching this?

@micahgodbolt
Copy link
Member

@cschlechty should we be using buttons for all clickable elements in the calendar? (dates included). If so, that might be outside the scope of this quick fix. I'd rather get this in and split that other work out to another PR.

onKeyDown={ (ev: React.KeyboardEvent<HTMLElement>) =>
this._navigateMonthEdge(ev, day.originalDate, weekIndex, dayIndex) }
aria-selected={ day.isSelected }
aria-label={ day.originalDate.toLocaleDateString() }
Copy link
Member

@dzearing dzearing Apr 15, 2017

Choose a reason for hiding this comment

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

This I believe requires IE11, which may not work on IE10. Though we plan to not support IE10 in the near future, just to be safe here couldn't we just ask the user to pass this in? Or at least make sure that day.originalDate.toLocaleDateString exists before calling it?

Copy link
Member

@dzearing dzearing left a comment

Choose a reason for hiding this comment

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

Could you just check for the method existence first? Also will day.originalDate ever be null or not a date?

@vibhava
Copy link

vibhava commented Apr 15, 2017

Thank you for making the change. Buttons for the clickable divs like Chris mentioned seems like a great idea.

Please feel free to won't fix/check with an expert/address in a separate change, but would it be appropriate to set autoFocus to true on the header (month and year name printed) when the dropdown opens so that tabbing would take me through all the contents of the calendar? I didn't think to hit shift tab because hitting tab twice again takes me out of it and closes the dropdown. I can see the benefit in setting focus to the current date too like you are currently doing and arrowing would take me to whichever month I want eventually.

I apologise for the delayed response, I was out of the office.

@micahgodbolt
Copy link
Member

Buttons replacing spans is moved to #1535 so this one looks good to merge.

@micahgodbolt micahgodbolt self-requested a review April 20, 2017 15:32
@MLoughry MLoughry merged commit 2d7733b into microsoft:master Apr 20, 2017
@MLoughry MLoughry deleted the calendar/add-aria-labels branch June 4, 2017 03:32
@microsoft microsoft locked as resolved and limited conversation to collaborators Aug 31, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants