File tree Expand file tree Collapse file tree 4 files changed +6
-9
lines changed
docs/src/app/components/pages/components Expand file tree Collapse file tree 4 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,7 @@ var SwitchesPage = React.createClass({
344344 id = "toggleId1"
345345 name = "toggleName1"
346346 value = "toggleValue1"
347- label = "activate thrusters"
348- onToggle = { this . _onToggle } />
347+ label = "activate thrusters" />
349348 </ div >
350349 < div className = "switches-example-container" >
351350 < Toggle
@@ -380,8 +379,7 @@ var SwitchesPage = React.createClass({
380379
381380 < RadioButtonGroup
382381 name = "shipSpeed"
383- defaultSelected = "not_light"
384- onChange = { this . _onRadioButtonClick } >
382+ defaultSelected = "not_light" >
385383 < RadioButton
386384 id = "radioButtonId1"
387385 value = "light"
Original file line number Diff line number Diff line change @@ -91,7 +91,7 @@ var Checkbox = React.createClass({
9191 } ,
9292
9393 _onCheck : function ( e , isInputChecked ) {
94- if ( ! this . props . hasOwnProperty ( 'checked' ) ) this . setState ( { checked : ! this . refs . enhancedSwitch . state . checked } ) ;
94+ if ( ! this . props . hasOwnProperty ( 'checked' ) ) this . setState ( { checked : isInputChecked } ) ;
9595 if ( this . props . onCheck ) this . props . onCheck ( e , isInputChecked ) ;
9696 } ,
9797
Original file line number Diff line number Diff line change @@ -34,7 +34,6 @@ var EnhancedSwitch = React.createClass({
3434 ( nextProps . defaultSwitched != this . props . defaultSwitched ) ) ;
3535 var newState = { } ;
3636
37-
3837 if ( hasCheckedProp ) {
3938 newState . switched = nextProps . checked ;
4039 } else if ( hasCheckedLinkProp ) {
@@ -95,7 +94,7 @@ var EnhancedSwitch = React.createClass({
9594
9695 _handleChange : function ( e ) {
9796 var isInputChecked = this . refs . checkbox . getDOMNode ( ) . checked ;
98-
97+
9998 if ( ! this . props . hasOwnProperty ( 'checked' ) ) this . setState ( { switched : isInputChecked } ) ;
10099 if ( this . props . onSwitch ) this . props . onSwitch ( e , isInputChecked ) ;
101100 } ,
Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ var Toggle = React.createClass({
9595 ref = "enhancedSwitch"
9696 inputType = "checkbox"
9797 onSwitch = { this . _onToggle }
98- defaultSwitched = { this . props . defaultToggled } />
98+ defaultChecked = { this . props . defaultToggled } />
9999
100100 { divsInOrder }
101101
@@ -104,7 +104,7 @@ var Toggle = React.createClass({
104104 } ,
105105
106106 _onToggle : function ( e , isInputChecked ) {
107- if ( ! this . props . hasOwnProperty ( 'checked' ) ) this . setState ( { toggled : ! this . refs . enhancedSwitch . state . toggled } ) ;
107+ if ( ! this . props . hasOwnProperty ( 'checked' ) ) this . setState ( { toggled : isInputChecked } ) ;
108108 if ( this . props . onToggle ) this . props . onToggle ( e , isInputChecked ) ;
109109 } ,
110110
You can’t perform that action at this time.
0 commit comments