Skip to content

Commit

Permalink
fix setValue prop to formsy version
Browse files Browse the repository at this point in the history
  • Loading branch information
lorensr committed Aug 10, 2016
1 parent d07e0de commit 41e5572
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FormsySegmentedControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const FormsySegmentedControl = React.createClass({
return (
<SegmentedControl
{...this.props}
setValue={this.setValue}
setValue={(val) => {
this.props.setValue && this.props.setValue(val)
return this.setValue(val) // Formsy's setValue
}}
/>
)
}
Expand Down
1 change: 1 addition & 0 deletions src/stories/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ storiesOf('FormsySegmentedControl', module)
{ label: "Three", value: "three" }
]}
style={{ width: 300, color: 'rgb(0, 188, 212)' }} // match default material-ui primary teal
setValue={action('setValue')}
/>
<RaisedButton
type="submit"
Expand Down

0 comments on commit 41e5572

Please sign in to comment.