File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,22 +57,16 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
5757 return ! this . _isChanging ;
5858 } ,
5959
60- getChecked : function ( ) {
61- return this . props . checked != null ? this . props . checked : this . state . checked ;
62- } ,
63-
64- getValue : function ( ) {
65- // Cast `this.props.value` to a string so equality checks pass.
66- return this . props . value != null ? '' + this . props . value : this . state . value ;
67- } ,
68-
6960 render : function ( ) {
7061 // Clone `this.props` so we don't mutate the input.
7162 var props = merge ( this . props ) ;
7263
73- props . checked = this . getChecked ( ) ;
74- props . value = this . getValue ( ) ;
75- props . onChange = this . handleChange ;
64+ props . checked =
65+ this . props . checked != null ? this . props . checked : this . state . checked ;
66+ // Cast `this.props.value` to a string so equality checks pass.
67+ props . value =
68+ this . props . value != null ? '' + this . props . value : this . state . value ;
69+ props . onChange = this . _handleChange ;
7670
7771 return input ( props , this . props . children ) ;
7872 } ,
@@ -96,7 +90,7 @@ var ReactDOMInput = ReactCompositeComponent.createClass({
9690 }
9791 } ,
9892
99- handleChange : function ( event ) {
93+ _handleChange : function ( event ) {
10094 var returnValue ;
10195 if ( this . props . onChange ) {
10296 this . _isChanging = true ;
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
116116 // Clone `this.props` so we don't mutate the input.
117117 var props = merge ( this . props ) ;
118118
119- props . onChange = this . handleChange ;
119+ props . onChange = this . _handleChange ;
120120 props . value = null ;
121121
122122 return select ( props , this . props . children ) ;
@@ -126,7 +126,7 @@ var ReactDOMSelect = ReactCompositeComponent.createClass({
126126
127127 componentDidUpdate : updateOptions ,
128128
129- handleChange : function ( event ) {
129+ _handleChange : function ( event ) {
130130 var returnValue ;
131131 if ( this . props . onChange ) {
132132 this . _isChanging = true ;
Original file line number Diff line number Diff line change @@ -93,10 +93,6 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
9393 return ! this . _isChanging ;
9494 } ,
9595
96- getValue : function ( ) {
97- return this . props . value != null ? this . props . value : this . state . value ;
98- } ,
99-
10096 render : function ( ) {
10197 // Clone `this.props` so we don't mutate the input.
10298 var props = merge ( this . props ) ;
@@ -106,8 +102,9 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
106102 '`dangerouslySetInnerHTML` does not make sense on <textarea>.'
107103 ) ;
108104
109- props . value = this . getValue ( ) ;
110- props . onChange = this . handleChange ;
105+ props . value =
106+ this . props . value != null ? this . props . value : this . state . value ;
107+ props . onChange = this . _handleChange ;
111108
112109 // Always set children to the same thing. In IE9, the selection range will
113110 // get reset if `textContent` is mutated.
@@ -124,7 +121,7 @@ var ReactDOMTextarea = ReactCompositeComponent.createClass({
124121 }
125122 } ,
126123
127- handleChange : function ( event ) {
124+ _handleChange : function ( event ) {
128125 var returnValue ;
129126 if ( this . props . onChange ) {
130127 this . _isChanging = true ;
You can’t perform that action at this time.
0 commit comments