Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Commit

Permalink
fix(AvRadioGroup): use spacing util instead of form-group
Browse files Browse the repository at this point in the history
bootstrap changed form-group to have a fixed height. It was previously used to add spacing between radio options. Now the height get jacked so this change makes it just use mb-3 which gives the same spacing as before
  • Loading branch information
TheSharpieOne committed Jul 25, 2018
1 parent f568d7e commit d75ef87
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
"homepage": "https://github.com/Availity/availity-reactstrap-validation",
"dependencies": {
"babel-runtime": "^6.26.0",
"classnames": "^2.2.3",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"prop-types": "^15.5.7"
"classnames": "^2.2.6",
"lodash": "^4.17.10",
"moment": "^2.22.2",
"prop-types": "^15.6.2"
},
"peerDependencies": {
"react": "^0.14.9 || ^15.3.0 || ^16.0.0",
Expand All @@ -67,7 +67,7 @@
},
"devDependencies": {
"babel-cli": "^6.10.1",
"babel-core": "^6.13.2",
"babel-core": "^6.26.3",
"babel-eslint": "^7.2.2",
"babel-loader": "^6.2.5",
"babel-plugin-istanbul": "^4.1.1",
Expand All @@ -79,23 +79,23 @@
"babel-preset-react": "^6.5.0",
"babel-preset-stage-0": "^6.5.0",
"babel-register": "^6.11.6",
"bootstrap": "^4.0.0",
"bootstrap": "^4.1.3",
"chai": "^3.5.0",
"chai-as-promised": "^6.0.0",
"chai-enzyme": "^0.6.1",
"cheerio": "^0.22.0",
"clean-webpack-plugin": "^0.1.8",
"conventional-changelog-cli": "^1.1.1",
"conventional-changelog-cli": "^1.3.22",
"conventional-recommended-bump": "^1.0.0",
"copy-webpack-plugin": "^3.0.1",
"coveralls": "^2.11.9",
"cross-env": "^4.0.0",
"css-loader": "^0.28.0",
"ejs": "^2.4.1",
"ejs": "^2.6.1",
"enzyme": "^2.8.2",
"eslint": "^3.3.1",
"eslint-config-availity": "^2.1.0",
"eslint-plugin-import": "^2.3.0",
"eslint-plugin-import": "^2.13.0",
"eslint-plugin-jsx-a11y": "^5.0.3",
"eslint-plugin-react": "^6.10.3",
"extract-text-webpack-plugin": "^1.0.1",
Expand All @@ -117,7 +117,7 @@
"react-router": "^2.0.1",
"react-test-renderer": "^15.5.4",
"react-transition-group": "^1.1.3",
"reactstrap": "^5.0.0-alpha.4",
"reactstrap": "^6.0.0",
"rimraf": "^2.5.4",
"sinon": "^2.1.0",
"sinon-chai": "^2.8.0",
Expand Down
8 changes: 7 additions & 1 deletion src/AvForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ export default class AvForm extends InputContainer {
validateAll: omit7,
validationEvent: omit8,
className,
children,
...attributes
} = this.props;

Expand All @@ -184,13 +185,18 @@ export default class AvForm extends InputContainer {
attributes.onKeyDown = this.handleNonFormSubmission;
}

let contents = children;
if (typeof children === 'function') {
contents = children({...this.getChildContext().FormCtrl, ...this.state, validateAll: this.validateAll, })
}

return (
<Tag noValidate
action="#"
{...attributes}
className={classes}
onSubmit={this.handleSubmit}
/>
>{children}</Tag>
);
}

Expand Down
6 changes: 4 additions & 2 deletions src/AvRadioGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ export default class AvRadioGroup extends Component {
touched && hasError && 'is-invalid'
);

attributes.className = classNames(attributes.className, 'mb-3');

return (
<FormGroup tag="fieldset" {...attributes}>
<fieldset {...attributes}>
{legend}
<div className={classes}>{children}</div>
<AvFeedback>{validation.errorMessage}</AvFeedback>
</FormGroup>
</fieldset>
);
}
}

0 comments on commit d75ef87

Please sign in to comment.