mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
@@ -107,6 +107,7 @@ var ReactDOMInput = {
|
||||
inst._wrapperState = {
|
||||
initialChecked: props.defaultChecked || false,
|
||||
initialValue: defaultValue != null ? defaultValue : null,
|
||||
listeners: null,
|
||||
onChange: _handleChange.bind(inst),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -174,6 +174,7 @@ var ReactDOMSelect = {
|
||||
inst._wrapperState = {
|
||||
pendingUpdate: false,
|
||||
initialValue: value != null ? value : props.defaultValue,
|
||||
listeners: null,
|
||||
onChange: _handleChange.bind(inst),
|
||||
wasMultiple: Boolean(props.multiple),
|
||||
};
|
||||
|
||||
@@ -128,6 +128,7 @@ var ReactDOMTextarea = {
|
||||
// The initial value can be a boolean or object so that's why it's
|
||||
// forced to be a string.
|
||||
initialValue: '' + (value != null ? value : defaultValue),
|
||||
listeners: null,
|
||||
onChange: _handleChange.bind(inst),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -570,29 +570,32 @@ ReactDOMComponent.Mixin = {
|
||||
case 'form':
|
||||
case 'video':
|
||||
case 'audio':
|
||||
this._setupTrapBubbledEventsLocal(transaction);
|
||||
this._wrapperState = {
|
||||
listeners: null,
|
||||
};
|
||||
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
||||
break;
|
||||
case 'button':
|
||||
props = ReactDOMButton.getNativeProps(this, props, nativeParent);
|
||||
break;
|
||||
case 'input':
|
||||
this._setupTrapBubbledEventsLocal(transaction);
|
||||
ReactDOMInput.mountWrapper(this, props, nativeParent);
|
||||
props = ReactDOMInput.getNativeProps(this, props);
|
||||
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
||||
break;
|
||||
case 'option':
|
||||
ReactDOMOption.mountWrapper(this, props, nativeParent);
|
||||
props = ReactDOMOption.getNativeProps(this, props);
|
||||
break;
|
||||
case 'select':
|
||||
this._setupTrapBubbledEventsLocal(transaction);
|
||||
ReactDOMSelect.mountWrapper(this, props, nativeParent);
|
||||
props = ReactDOMSelect.getNativeProps(this, props);
|
||||
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
||||
break;
|
||||
case 'textarea':
|
||||
this._setupTrapBubbledEventsLocal(transaction);
|
||||
ReactDOMTextarea.mountWrapper(this, props, nativeParent);
|
||||
props = ReactDOMTextarea.getNativeProps(this, props);
|
||||
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -699,19 +702,6 @@ ReactDOMComponent.Mixin = {
|
||||
return mountImage;
|
||||
},
|
||||
|
||||
/**
|
||||
* Setup this component to trap non-bubbling events locally
|
||||
*
|
||||
* @private
|
||||
* @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
|
||||
*/
|
||||
_setupTrapBubbledEventsLocal: function(transaction) {
|
||||
this._wrapperState = {
|
||||
listeners: null,
|
||||
};
|
||||
transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates markup for the open tag and all attributes.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user