Skip to content
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

fix(SITES-2874 Accessibility) - Visual list is not marked up as list. #320

Closed
wants to merge 14 commits into from
6 changes: 5 additions & 1 deletion coral-component-list/src/scripts/AnchorList.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,14 @@ const AnchorList = Decorator(class extends BaseList(BaseComponent(HTMLElement))
this._trackEvent('click', 'coral-anchorlist-item', event, event.matchedTarget);
}

_addRoleList() {
this.setAttribute('role', 'list');
}

/** @ignore */
render() {
super.render();

this._addRoleList();
this.classList.add(CLASSNAME);
}
});
Expand Down
6 changes: 5 additions & 1 deletion coral-component-list/src/scripts/AnchorListItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ const AnchorListItem = Decorator(class extends BaseListItem(BaseComponent(HTMLAn
}
}

_addRolesList() {
this.setAttribute('role', 'listitem');
}

/** @ignore */
render() {
super.render();

this._addRolesList();
this.classList.add(CLASSNAME);
}
});
Expand Down
Loading