-
Couldn't load subscription status.
- Fork 1
A11y cleanup #8
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
A11y cleanup #8
Conversation
|
Switching to draft. The listbox role oughta get added via lifecycle hook in case the Draggable PR isn't getting action. |
| }, | ||
| ); | ||
| const updateRoles = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we add a todo to refactor this if SortableJS/vue.draggable.next#35 ever lands?
src/App.vue
Outdated
| }); | ||
| onUpdated(() => { | ||
| updateRoles() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this need to be fired so often? seems like it's a no-op most of the time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't, apparently. I thought the attributes got wiped out when buttons were moved, but looks like that was misdiagnosed.
| </div> | ||
| <div class="ckeditor5-toolbar-active"> | ||
| <label for="ckeditor5-toolbar-active__buttons">Active toolbar</label> | ||
| <label id="ckeditor5-toolbar-active__buttons-label">Active toolbar</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, now this is the label that the list is labelled-by
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, the for attribute in a label only works with 'labelable' elements https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/Content_categories#Form_labelable so this needs to use aria-labelledby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the detailed explanations @bbenjamin , I always learn something about a11y from these changes :) There's no functional differences here, just better use of labels and aria-attributes, and you already addressed the 2 issues I raised. 👍
This addresses fairly basic things, several of which would be flagged in automated checks.
ulelements are not labelable, so the labels for the button lists need to be associated by using aria-labelledby.ulelements need to be seen as form elements. The CK4 approach was to give themrole="form:, which makes them labelable, but semanically confusing due to their being a form within a form. Changed to userole="listbox"via regular JS as Sortable filters role and aria attributes and I'm unsure when/if the PR addressing this will land https://github.com/zrpnr/ckeditor5-drupal-admin/pull/new/a11y-cleanupspanwithin the button was invisible to eyes and screenreaders due to being visually-hidden and aria-hidden. This also triggered concerns on Axe dev tools as it expected<a>tags to have content. The aria hidden was removed so it's visible to screenreaders.