-
Notifications
You must be signed in to change notification settings - Fork 352
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
fix(Form): Do not add any class if action modifier is missing #792
Conversation
PatternFly-React preview: https://792-pr-patternfly-react-patternfly.surge.sh |
@@ -17,7 +17,7 @@ const defaultProps = { | |||
}; | |||
|
|||
const ActionGroup = ({ className, children, ...props }) => { | |||
const customClassName = css(styles.formGroup, getModifier(styles, 'action', styles.modifiers.info), className); | |||
const customClassName = css(styles.formGroup, getModifier(styles, 'action'), className); |
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 missed this in the last review. it would probably be better to just use styles.modifiers.action
const customClassName = css(styles.formGroup, getModifier(styles, 'action'), className); | |
const customClassName = css(styles.formGroup, styles.modifiers.action, className); |
This would allow the babel plugin to throw at build time if this is ever modified. getModifier should only be used if the modifier is coming in via props.
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.
@karelhala Thanks for fixing this! 👍 🙏
Optional, Nit/ we can remove classes for styles and write them in-line
<div {...props} className={css(styles.formGroup, styles.modifiers.action, className)}> {isHorizontal ? <div className={css(styles.formHorizontalGroup)}>{children}</div> : children} </div>
@karelhala do you mind modifying this line too: it should be |
Pull Request Test Coverage Report for Build 2672
💛 - Coveralls |
#797 addressed some of these issues as well. We can use this PR to make the change to not use getModifier in the cases where modifier is not coming in via prop |
8d22175
to
6a0e49f
Compare
Fixes currently broken master, because there is no info modifier for FormGroup.