-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(skeleton-components): update labels & attributes for Checkbox, NumberInput, Select, Slider, TextArea, and TextInput #4307
fix(skeleton-components): update labels & attributes for Checkbox, NumberInput, Select, Slider, TextArea, and TextInput #4307
Conversation
Tagging @dakahn for this one as well ☝️ |
Deploy preview for the-carbon-components ready! Built with commit 095f70e https://deploy-preview-4307--the-carbon-components.netlify.com |
Deploy preview for carbon-components-react ready! Built with commit 095f70e https://deploy-preview-4307--carbon-components-react.netlify.com |
Deploy preview for carbon-elements ready! Built with commit 095f70e |
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.
Our requirements around skeletons (loading states) for components are changing. Referencing two things here:
https://www.w3.org/WAI/WCAG21/Understanding/status-messages.html
https://www.ibm.com/able/guidelines/ci162/status_messages_71.html
There's a lot in there, but relevant to this PR is our skeletons do actually need to be interactable in so far as they can receive focus (be tabbable) and communicate the status via aria of that particular component.
Thanks @dakahn that's very interesting 🤔 I could add a tabindex to these elements for now? |
Thanks again @dakahn -- I just added |
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.
LGTM 👍 - Thanks @jendowns!
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.
hideLabel
logic for the TextInput
skeleton is reversed, otherwise looks good to me
Co-Authored-By: emyarod <emyarod@users.noreply.github.com>
Thanks @emyarod! Just committed your suggestion 👍 |
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.
LGTM! I'm not seeing the DAP violation anymore 👍
@dakahn I would think we'd want folks to specify that a region is loading versus specific components, or at the very least incorporate |
Quick demo of what I mean: Screen Recording 2019-10-15 at 11.55.29 AM.zip Codepen: https://codepen.io/joshblack/pen/ZEEWZYr?editors=1011 The way it works is that clicking the button would change the attributes of each of the outlined spans so that |
@dakahn @joshblack Oh whoa, that's interesting... so maybe I should remove |
@jendowns yeah, my guess is that if we want to remove the violations we should just treat these as decorative content until we figure out a live region example. This would mean removing those aria attributes, I believe, in the skeletons. The only follow-up would be that the stories should most likely be updated to be in a live region example that does have these attributes, right @dakahn? I think if we can figure that out then this should be good to go |
@dakahn @joshblack I just removed the |
I say go for it, what do you think @dakahn? Only thing will be to make sure the skeleton stories do include a region that has all of these attributes on it. |
@dakahn @joshblack in my last 2 comments, I removed |
Hmm, tested with NVDA on latest Chrome and I'm not getting an announcement on page load that there is a component loading. I think your aria might be getting clobbered by the aria on the "main" Storybook element, but I'm not sure. |
@dakahn hmm, seems to work in VO so maybe there is an additional requirement for NVDA that we don't know about? |
That's fine. Green check from me. Let's get it in. |
Just to clarify what we're looking for here: We want no aria on the skeletons themselves. This will clear the DAP violation. Then we want a wrapper div with the aria required to announce the loading state. This doesn't technically help our shipping skeletons be any more accessible, but the plan is to work on a region pattern users can implement around their skeletons in a coming work cycle. |
@dakahn @joshblack I just pushed a commit that moves |
Closes #4176
Also partially addresses #4310
The components flagged in #4176 had
label
elements that weren't tied to any particularinput
, because these are allnon-interactiveskeleton components. So I changed thoselabel
elements tospans
Changelog
Changed
label
element to aspan
aria-label="loading [component name]"
,aria-live="assertive"
,role="status"
, andtabindex="0"
to the wrapper elementTesting / Reviewing
Open the
carbon-components-react
deployment review and check these skeleton components against the latest Sept 2019 ruleset with the DAP tool.