Skip to content

Commit

Permalink
fix(FormCustom): moved props spreading to Input rather than Label.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Janet committed Jan 21, 2019
1 parent b8feea3 commit 1524e22
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Form/FormCustom.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const propTypes = {
};
class FormCustom extends React.Component {// eslint-disable-line react/prefer-stateless-function
static propTypes = propTypes;

render() {
const {
className,
Expand All @@ -54,12 +53,12 @@ class FormCustom extends React.Component {// eslint-disable-line react/prefer-st
), cssModule);

const CustomInput = radio ? (
<Input defaultChecked={defaultChecked} checked={checked} type="radio" id={radio.id} name={radio.name} className="custom-control-input" />
<Input defaultChecked={defaultChecked} checked={checked} type="radio" id={radio.id} name={radio.name} className="custom-control-input" {...attributes} />
) : (
<Input defaultChecked={defaultChecked} checked={checked} type="checkbox" className="custom-control-input" />
<Input defaultChecked={defaultChecked} checked={checked} type="checkbox" className="custom-control-input" {...attributes} />
);
return (
<Label className={classes} {...attributes}>
<Label className={classes}>
{CustomInput}
<span className="custom-control-indicator"></span>
<span className="custom-control-description">{children}</span>
Expand Down

0 comments on commit 1524e22

Please sign in to comment.