Skip to content

Commit

Permalink
Merge pull request #95 from sflpro/feature-toggle-button-validation
Browse files Browse the repository at this point in the history
fix: Set checked field for toggleButton in  withValidation
  • Loading branch information
edgar-poghosyan-sfl authored Sep 3, 2020
2 parents 9846d80 + a8aefa8 commit 9bcf0f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ToggleButton/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ export function ToggleButton({
);
}

ToggleButton.displayName = 'ToggleButton';

ToggleButton.propTypes = {
/** Function, will be called when toggle value will be changed */
onChange: PropTypes.func,
Expand Down
2 changes: 1 addition & 1 deletion src/WithValidation/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export class WithValidation extends React.Component {
errors,
} = this.context;

const passChecked = ['Checkbox', 'RadioButton'].includes(Component.displayName);
const passChecked = ['Checkbox', 'RadioButton', 'ToggleButton'].includes(Component.displayName);

return (
<Component
Expand Down

0 comments on commit 9bcf0f1

Please sign in to comment.