Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Fix repeater missing aria attributes #1758

Merged
merged 48 commits into from
Sep 25, 2018

Conversation

blackbaud-conorwright
Copy link
Contributor

Added missing aria labels for the repeater component

Resolves: #1377

blackbaud-conorwright and others added 26 commits March 7, 2018 17:17
@codecov-io
Copy link

codecov-io commented Jun 27, 2018

Codecov Report

Merging #1758 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1758      +/-   ##
==========================================
+ Coverage   99.94%   99.94%   +<.01%     
==========================================
  Files         418      418              
  Lines        8917     8919       +2     
  Branches     1326     1326              
==========================================
+ Hits         8912     8914       +2     
  Misses          5        5
Impacted Files Coverage Δ
...modules/colorpicker/colorpicker-input.directive.ts 100% <ø> (ø) ⬆️
src/modules/repeater/repeater-item.component.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0f234a3...fe32036. Read the comment docs.

<div
class="sky-repeater-item-content"
[id]="contentId"
role="region"

Choose a reason for hiding this comment

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

I saw this on the ARIA docs, "Avoid using the region role in circumstances that create landmark region proliferation, e.g., in an accordion that contains more than approximately 6 panels that can be expanded at the same time." https://www.w3.org/TR/wai-aria-practices-1.1/#accordion

@Blackbaud-MattGregg I'm curious if we should remove the role="region" since the repeater can have all items opened at once?

Copy link
Contributor

@Blackbaud-MattGregg Blackbaud-MattGregg Jul 10, 2018

Choose a reason for hiding this comment

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

@Blackbaud-SteveBrush I believe we should remove though I think the issue is more with these being <section> elements which are the same semantically as role="region" in ARIA. It also surfaces another thorny issue (heading hierarchy) to tackle. I'm not sure we want to open that can of worms at this point. I'd suggest we open a new issue and prioritize it separately.
I'm not sure why items in a list turn into sections when viewed as a repeater so maybe there is a back story there to understand. They don't seem like they should be sections from a semantic structure POV and this isn't a component to use as an accordion (i.e., separate sections of content with a heading). It's a list of something.
If we did remove the regions/sections, I think it would require us to decide what to do with the heading hierarchy. Currently the regions/sections use H1s for their headings which I assume was meant to work with the HTML5 outline algorithm where one lays out multiple sections each with their own hierarchy starting from H1. My understanding is this was reversed/deprecated in HTML 5.1 and browsers never implemented it well or consistently. Hence, we'd need to figure out what to do with heading strategy.

Choose a reason for hiding this comment

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

@Blackbaud-MattGregg I believe the decision for <section> was made based on what you described, but has since been deprecated. I don't think it'll be a problem to replace the <section> tags with simple <div> tags.

For the headings, we could replace the <h1> and use <div role="heading">.
Based on reading this: https://www.w3.org/TR/WCAG20-TECHS/ARIA12.html (see "Example 1: Simple headings").

"...when retrofitting a legacy site where scripts depend on the existing element hierarchy or the level is unknown. For example, web content which is syndicated from various sources may be constructed without knowledge of what the final presentation will be."

Thoughts on that?

Copy link
Contributor

Choose a reason for hiding this comment

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

@Blackbaud-SteveBrush @blackbaud-conorwright I think replacing the <section> with <div> would be the way to go. Given the sections don't then need headings, I don't think the system should provide headings at all.

If a using application actually has a page where the repeater has a list of heading for some reason they can put their headings in there in the content and use the appropriate heading level (h2, h3, etc.) given the structure of the page. I don't think we want to guess the heading level and I can't think of a good reason for enforcing headings here especially b/c I think in the majority of cases I've seen these wouldn't be headings.

@Blackbaud-SteveBrush Blackbaud-SteveBrush self-assigned this Jul 2, 2018
@Blackbaud-SteveBrush Blackbaud-SteveBrush changed the title Fix repeater missing aria attributes [HOLD] Fix repeater missing aria attributes Jul 31, 2018
@Blackbaud-AlexKingman Blackbaud-AlexKingman changed the title [HOLD] Fix repeater missing aria attributes Fix repeater missing aria attributes Aug 15, 2018
@blackbaud-conorwright
Copy link
Contributor Author

@Blackbaud-MattGregg and @Blackbaud-SteveBrush Alright, I've updated to remove the role, switch section to be a div, and I also changed the h1 tag to be a div so that users may supply their own inside it if they wish.

Copy link
Member

@Blackbaud-SteveBrush Blackbaud-SteveBrush left a comment

Choose a reason for hiding this comment

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

One small thing.

@@ -39,6 +39,8 @@
.sky-repeater-item-title {
margin: 0;
flex-grow: 1;
line-height: 1.1;
color: #282b31;

Choose a reason for hiding this comment

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

Should be $sky-text-color-default, I believe.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed.

@blackbaud-conorwright blackbaud-conorwright merged commit c1ba9a5 into master Sep 25, 2018
@blackbaud-conorwright blackbaud-conorwright deleted the fix-repeater-missing-aria-attributes branch September 25, 2018 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants