Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(chip): added role and aria-label to match react#5765

Merged
mcoker merged 4 commits intopatternfly:mainfrom
ashley-o0o:5258-chiprole
Jul 31, 2023
Merged

fix(chip): added role and aria-label to match react#5765
mcoker merged 4 commits intopatternfly:mainfrom
ashley-o0o:5258-chiprole

Conversation

@ashley-o0o
Copy link
Contributor

closes: #5258

@ashley-o0o ashley-o0o requested a review from thatblindgeye July 13, 2023 17:38
@patternfly-build
Copy link
Collaborator

patternfly-build commented Jul 13, 2023

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

In addition to the below comment, we should remove aria-hidden="true" from the chip-group-label file, as that causes a chip group category's close button to not be announced correctly in VoiceOver

@@ -1,4 +1,6 @@
<div class="{{pfv}}chip-group{{#if chip-group--modifier}} {{chip-group--modifier}}{{/if}}"
role="group"
aria-label="Chip group category"
Copy link
Contributor

Choose a reason for hiding this comment

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

Rather than hardcoding this, we should allow passing in whatever value we may need for the example. We'd also want to utilize aria-labelledby for when a chip group has a visible text label (aria-label should be for when there's no visible text label in the "Simple inline..." examples).

For this file, let's update this to something like:

Suggested change
aria-label="Chip group category"
{{#if chip-group--HasCategoryText}}
aria-labelledby="{{chip-group--id}}-label"
{{else if chip-group--aria-label}}
aria-label="{{chip-group--aria-label}}"
{{/if}}

Then we can update the examples accordingly:

  • The "Simple inline chip group..." examples can have the chip-group--aria-label passed in. We'll want whatever value passed in to describe the chip group enough; using part of the example titles could work
  • The "Chip groups with categories" examples will have the chip-group--HasCategoryText (or whatever you think a good name is)

@ashley-o0o ashley-o0o requested a review from thatblindgeye July 19, 2023 14:04
Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

🎉 The surge preview doesn't seem up to date, but pulling your branch locally things look as expected

Copy link
Contributor

@mcoker mcoker left a comment

Choose a reason for hiding this comment

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

🥳👍

@mcoker mcoker merged commit ffd8cea into patternfly:main Jul 31, 2023
@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 5.1.0-prerelease.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@patternfly-build
Copy link
Collaborator

🎉 This PR is included in version 6.0.0-alpha.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug - Chip group: align with React markup

4 participants