-
Notifications
You must be signed in to change notification settings - Fork 1k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support HelpText/FieldError for standalone Checkbox, Radio, and Switch #6192
Comments
Hi! i'm looking at this issue because i was thinking of implementing something similar in my design system.
In Spectrum and RAC Starter kits, fields are usually wrapped and offer props like description, errorMessage and label. So i imagine the component in RAC Starter kit would look like this.
Would the intention in the starter kit be to completely replace Checkbox, or would the intention be to use Checkbox and CheckboxField as needed, for instance inside a CheckboxGroup?
|
Good question, I'd lean towards always having CheckboxField aka completely replace Checkbox in the starter kit. Can't really think of any reasons to have the two separated within the starter kit itself, but if you were just to use RAC as is you'd be able to use Checkbox standalone vs wrapping it in a CheckboxField when needed. Note that its pretty early days for this HelpText support for these components so the API is still subject to change as the team discusses it some more. |
I'm working on something similar too. I think the standalone Checkbox should be used inside CheckboxGroup, which is itself a form field. CheckboxField within CheckboxGroup(Field) would be a little strange I guess. The standalone Checkbox can also be used in other components like Table. So I guess for the starter kit, it still makes sense to have a separate Checkbox. |
Provide a general summary of the feature here
We will want to support HelpText/FieldError for standalone Checkbox and Radio. Switch should support just HelpText.
馃 Expected Behavior?
The api should look something like this (naming of the wrapper to be finalized):
Note that the field error context will need to be set in the wrapper
馃槸 Current Behavior
HelpText/FieldError isn't supported for any of these components yet
馃拋 Possible Solution
No response
馃敠 Context
These are all valid use cases for these components, we just didn't add support for them yet
馃捇 Examples
No response
馃Б Your Company/Team
RSP
馃暦 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: