-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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(forms): add segmented radio field #83557
Conversation
|
||
return ( | ||
<Tooltip | ||
key={index} |
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.
key could maybe be id but maybe we don't know that will be unique
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.
i think this generally makes sense, but we may want to decide on the react-hook-form vs components/Form before we do too many of these components to avoid any extra work.
import {space} from 'sentry/styles/space'; | ||
|
||
export interface SegmentedRadioFieldProps extends Omit<InputFieldProps, 'type'> { | ||
choices?: RadioGroupProps<any>['choices']; |
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.
🤔 should this any
propagate the generic type down instead?
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.
Ah great catch, missed this in the copy + paste. Fixed in 2889f50!
link to one of the recent vercel stories https://sentry-i5qt28rm9.sentry.dev/stories/?name=app%2Fcomponents%2Fforms%2Ffields%2Findex.stories.tsx&query= |
Bundle ReportChanges will increase total bundle size by 3.78kB (0.01%) ⬆️. This is within the configured threshold ✅ Detailed changes
|
9541fb8
to
2889f50
Compare
Introduces a new segmented radio field (mostly copied from the existing radio field, with some styling changes) - fixes an accessibility issue with the existing radio field, which did not pass `name` down to the `input`. Without this change, keyboard navigation for multiple radio fields on the same page was broken.
Part of ACI M6.1.
name
down to theinput
. Without this change, keyboard navigation for multiple radio fields on the same page was broken.