From 881873c10fc91aea9b0982c188a12360ebdd349c Mon Sep 17 00:00:00 2001 From: Jed Watson Date: Wed, 1 Feb 2017 01:50:36 +1100 Subject: [PATCH] Cleaning up boolean value example --- examples/src/components/BooleanSelect.js | 54 +----------------------- 1 file changed, 1 insertion(+), 53 deletions(-) diff --git a/examples/src/components/BooleanSelect.js b/examples/src/components/BooleanSelect.js index c80ffc35f6..31a87f0c48 100644 --- a/examples/src/components/BooleanSelect.js +++ b/examples/src/components/BooleanSelect.js @@ -12,75 +12,23 @@ var ValuesAsBooleansField = React.createClass({ { value: true, label: 'Yes' }, { value: false, label: 'No' } ], - matchPos: 'any', - matchValue: true, - matchLabel: true, - value: null, - multi: false + value: null }; }, - onChangeMatchStart(event) { - this.setState({ - matchPos: event.target.checked ? 'start' : 'any' - }); - }, - onChangeMatchValue(event) { - this.setState({ - matchValue: event.target.checked - }); - }, - onChangeMatchLabel(event) { - this.setState({ - matchLabel: event.target.checked - }); - }, onChange(value) { this.setState({ value }); console.log('Boolean Select value changed to', value); }, - onChangeMulti(event) { - this.setState({ - multi: event.target.checked - }); - }, render () { - var matchProp = 'any'; - if (this.state.matchLabel && !this.state.matchValue) { - matchProp = 'label'; - } - if (!this.state.matchLabel && this.state.matchValue) { - matchProp = 'value'; - } return (

{this.props.label}

- Multi-Select - - - - -
This example uses simple boolean values
);