Fix aria roles on weekday and month elements #276
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes: #277
Per https://www.w3.org/TR/wai-aria/roles#columnheader, the
columnheader
role should go on the equivalent of a<th>
element and should be owned by something with therow
role.Also, per https://www.w3.org/TR/wai-aria/roles#rowgroup
rowgroup
elements should be owned by something with agrid
role, so I moved that up as well.However, this does pose a bit of an issue for people using the
weekdayElement
prop. Since you're not outputting the result of that in a wrapping div, people passing in an element on that prop will need to be sure to output that role themselves.Another possible change is for the library to output the wrapping div with the classname and role. I think that would be a breaking change (resulting change in HTML would probably throw off some people's layout CSS), so I'm not attempting that here.
cc: @gpbl