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

Accessibility tweaks #15

Merged
merged 8 commits into from
Feb 9, 2021
Merged

Accessibility tweaks #15

merged 8 commits into from
Feb 9, 2021

Conversation

anezthes
Copy link
Collaborator

@anezthes anezthes commented Feb 8, 2021

...and some minor theme related additions (Lumo/Material).

Verified

This commit was signed with the committer’s verified signature.
abernix Jesse Rosenberger
</template>
<ol>
<template is="dom-repeat" items="[[items]]">
<vaadin-message time="[[item.time]]" user="[[item.user]]">[[item.text]]</vaadin-message>
Copy link

Choose a reason for hiding this comment

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

I think you have to add <li> inside the <ol> for valid html.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really a fan of complicating our DOM structure with <ol> and <li>. I saw the comment that you should avoid role="" if you can do it with the correct native HTML elements, but I still think it brings in more possible issues than what benefits we get for it. Like deeper DOM, and possible unforeseen css rules in different environments. Other components in Vaadin has already used role="list" and role="listitem" and we will ensure accessibility compatibility.

Copy link

Choose a reason for hiding this comment

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

@Peppe understandable! I would remove <ol> then and use <div role=list> or something else. Looking at the HTML spec using <ol> without <li> is a violation: https://www.w3.org/TR/html52/grouping-content.html#the-ol-element

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed!

Copy link

Choose a reason for hiding this comment

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

Updated my #14 - looks good!

@knoobie knoobie mentioned this pull request Feb 8, 2021
5 tasks
@@ -151,7 +153,6 @@ class MessageElement extends ElementMixin(ThemableMixin(PolymerElement)) {

ready() {
super.ready();
this.setAttribute('aria-live', 'polite');
this.setAttribute('role', 'listitem');
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be moved to src/vaadin-message-list.js#87. It would mean that the message-list puts role="listitem" on message. If someone would initialize a message standalone, then there wouldn't be dangling role="listitem", without a parent with role="log".

@Peppe Peppe merged commit 121fa4c into master Feb 9, 2021
@Peppe Peppe deleted the a11y branch February 9, 2021 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants