Skip to content

Comments

feat(radio-simple and group): make aria-label(ledby) required#747

Merged
nataliadelmar merged 4 commits intomomentum-design:masterfrom
nataliadelmar:radioSimpleGroupLabel
Jan 7, 2025
Merged

feat(radio-simple and group): make aria-label(ledby) required#747
nataliadelmar merged 4 commits intomomentum-design:masterfrom
nataliadelmar:radioSimpleGroupLabel

Conversation

@nataliadelmar
Copy link
Collaborator

@nataliadelmar nataliadelmar commented Jan 2, 2025

Make aria-label(ledby) required on RadioSimple and RadioSimpleGroup.

On RadioSimpleGroup, if a label prop is passed, useRadioGroup automatically links it to the group with aria-labelledby. No need to link them manually.

RadioSimpleGroup: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-598563
RadioSimple: https://jira-eng-gpk2.cisco.com/jira/browse/SPARK-598565

@nataliadelmar nataliadelmar added the validated If the pull request is validated automation. label Jan 2, 2025
ariaLabelledBy?: string;
import { AriaLabelRequired } from '../../utils/a11y';

export type RadioSimpleProps = AriaLabelRequired & {
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: can we add back AriaRadioProps. It adds a few aria props that we are losing by removing it.

className?: string;
export type RadioSimpleGroupProps = AriaRadioGroupProps &
AriaLabelingProps &
(
Copy link
Collaborator

Choose a reason for hiding this comment

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

suggestion: use RequireOneOf. See Checkbox.types.tsx

Copy link
Collaborator

@dominiccarrington dominiccarrington left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for addressing comments!

@nataliadelmar nataliadelmar merged commit 6f15516 into momentum-design:master Jan 7, 2025
5 checks passed
@github-actions
Copy link

github-actions bot commented Jan 7, 2025

🎉 This PR is included in version 26.193.0 🎉

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

Labels

released validated If the pull request is validated automation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants