chore(expandable section): add missing aria attributes to examples - #7754
Conversation
|
Preview: https://pf-pr-7754.surge.sh A11y report: https://pf-pr-7754-a11y.surge.sh |
| @@ -7,6 +7,7 @@ | |||
| button--IsInline=expandable-section--IsTruncate | |||
| button--IsAriaExpanded=expandable-section--IsExpanded | |||
| button--aria-controls=(ternary expandable-section--IsDetached (concat expandable-section--id '-content') null) | |||
There was a problem hiding this comment.
This should be updated to render the aria-controls properly. Right now it's only rendering for detached variants, but we want it regardless of variant as long as an ID is passed.
| button--aria-controls=(ternary expandable-section--IsDetached (concat expandable-section--id '-content') null) | |
| button--aria-controls=(ternary expandable-section--id (concat expandable-section--id '-content') null) |
| @@ -7,6 +7,7 @@ | |||
| button--IsInline=expandable-section--IsTruncate | |||
| button--IsAriaExpanded=expandable-section--IsExpanded | |||
There was a problem hiding this comment.
@mcoker are you opposed to replacing instances of button--IsAriaExpanded in Core handlebars files with just button--IsExpanded? Only 5 instances of IsAriaExpanded in the codebase, and the logic in Button doesn't take that into account when setting the actual aria-expanded attribute (it checks if either IsExpanded or IsAriaExpanded is true, but then only sets aria-expanded based on IsExpanded). Having separate Disabled and AriaDisabled attr is fine since they're distinct things, but there's only an aria-expanded attr so just using IsExpanded is fine.
If you're okay with that, then for this PR we can just update this line to:
button--IsExpanded=(ternary expandable-section--IsExpanded true false)(since we always want aria-expanded rendered whether true or false for this component), and open a followup for the other files (unless you want to update them here @Mash707, shouldn't take long at all).
There was a problem hiding this comment.
@Mash707 ignore this comment for this PR. Coker and I met up to discuss this and I'll put a followup PR to update this across components.
419ae98 to
d19e9d0
Compare
|
🎉 This PR is included in version 6.3.0-prerelease.62 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Fixes #7280