-
Notifications
You must be signed in to change notification settings - Fork 77
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: add textClassName prop and unit test #1184
Conversation
Deploy preview for fundamental-react ready! Built with commit 11c3c9f |
src/Forms/Checkbox.test.js
Outdated
@@ -119,6 +119,16 @@ describe('<Checkbox />', () => { | |||
).toContain('wonderful-styles'); | |||
}); | |||
|
|||
test('should set validationClassName on the popover', () => { |
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 set childrenClassName on the checkbox children
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.
Oh that is super weird. I was sure I changed the title of this test, thanks!
src/Forms/Checkbox.js
Outdated
@@ -119,6 +125,8 @@ Please ensure you are either using a visible \`FormLabel\` or an \`aria-label\` | |||
); | |||
} | |||
}, | |||
/** Additional classes to apply to children */ | |||
childrenClassName: PropTypes.string, |
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 we have to be a little more careful with the name here - if the child is not a string, it won't add this class. Do we want that? Do we not? I don't know...
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 also thought perhaps this was not the best name. Would you have a suggestion of a more semantic, or explicit name? Perhaps stringChildrenClassName
?
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 textClassName
would be fine
Description
This adds the
textClassName
prop inside ofCheckbox
in order for custom classes to be applied to the element. This is necessary for styles to target the class name and be applied directly to the children. This does not change the way the component originally works since the standard class will always be applied.Linked to PR: https://github.concur.com/coreui/nui-widgets-lab/pull/124
Added Unit tests