-
Notifications
You must be signed in to change notification settings - Fork 96
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
feat(radio): add pf-radio #2882
base: main
Are you sure you want to change the base?
feat(radio): add pf-radio #2882
Conversation
|
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
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.
Tabbing Behavior
Looking at the "Multiple Groups" demo in Safari 18.1.1, there's currently some very strange tabbing behavior.
This can be fixed by giving unique values to the name
attributes for each radio group. For example:
<p><code><pf-radio></code> group with same name inside different parent</p>
<div class="radio-group-container">
<div class="radio-group">
<p>Score: </p>
<pf-radio value="a" name="score2" label="A"></pf-radio>
<pf-radio value="b" name="score2" label="B"></pf-radio>
<pf-radio value="c" name="score2" label="C"></pf-radio>
</div>
...
</div>
Note the unique score2
value for name
. The name
attributes in the other radio groups should be made unique as well.
Fieldset and legend
Instead of using <div class="radio-group">
and <p>
tags for labels, use <fieldset>
and <legend>
for optimum accessibility. WebAIM fieldset / legend reference.
Screen Reader Testing
When this component is close to being "done", it's probably a good idea to have @hellogreg test it out with various screen readers to ensure it's accessible everywhere.
What I did
Developed a custom
pf-radio
component utilizing the standard<input type="radio" />
element for enhanced functionality and styling.Testing Instructions
Deploy preview demo
1. Mouse Interaction
2. Keyboard Navigation
Notes to Reviewers
Please note that the CSS variables, code comments, test cases, and updated documentation will be added asap.