Follow-ups to #5187
Ben Alpert committed
Oct 19, 2015 at 11:15 UTC
545f31741e89696877393350722af824ffa08900
4 files changed
+10
-17
src/renderers/dom/client/wrappers/ReactDOMInput.js
+1
@@ -107,6 +107,7 @@ var ReactDOMInput = {
107
inst._wrapperState = {
108
initialChecked: props.defaultChecked || false,
109
initialValue: defaultValue != null ? defaultValue : null,
110
+ listeners: null,
111
onChange: _handleChange.bind(inst),
112
};
113
},
src/renderers/dom/client/wrappers/ReactDOMSelect.js
+1
@@ -174,6 +174,7 @@ var ReactDOMSelect = {
174
inst._wrapperState = {
175
pendingUpdate: false,
176
initialValue: value != null ? value : props.defaultValue,
177
+ listeners: null,
178
onChange: _handleChange.bind(inst),
179
wasMultiple: Boolean(props.multiple),
180
};
src/renderers/dom/client/wrappers/ReactDOMTextarea.js
+1
@@ -128,6 +128,7 @@ var ReactDOMTextarea = {
128
// The initial value can be a boolean or object so that's why it's
129
// forced to be a string.
130
initialValue: '' + (value != null ? value : defaultValue),
131
+ listeners: null,
132
onChange: _handleChange.bind(inst),
133
};
134
},
src/renderers/dom/shared/ReactDOMComponent.js
+7
-17
@@ -570,29 +570,32 @@ ReactDOMComponent.Mixin = {
570
case 'form':
571
case 'video':
572
case 'audio':
573
- this._setupTrapBubbledEventsLocal(transaction);
573
+ this._wrapperState = {
574
+ listeners: null,
575
+ };
576
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
577
break;
578
case 'button':
579
props = ReactDOMButton.getNativeProps(this, props, nativeParent);
580
break;
581
case 'input':
579
- this._setupTrapBubbledEventsLocal(transaction);
582
ReactDOMInput.mountWrapper(this, props, nativeParent);
583
props = ReactDOMInput.getNativeProps(this, props);
584
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
585
break;
586
case 'option':
587
ReactDOMOption.mountWrapper(this, props, nativeParent);
588
props = ReactDOMOption.getNativeProps(this, props);
589
break;
590
case 'select':
588
- this._setupTrapBubbledEventsLocal(transaction);
591
ReactDOMSelect.mountWrapper(this, props, nativeParent);
592
props = ReactDOMSelect.getNativeProps(this, props);
593
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
594
break;
595
case 'textarea':
593
- this._setupTrapBubbledEventsLocal(transaction);
596
ReactDOMTextarea.mountWrapper(this, props, nativeParent);
597
props = ReactDOMTextarea.getNativeProps(this, props);
598
+ transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
599
break;
600
}
601
@@ -699,19 +702,6 @@ ReactDOMComponent.Mixin = {
702
return mountImage;
703
},
704
702
- /**
703
- * Setup this component to trap non-bubbling events locally
704
- *
705
- * @private
706
- * @param {ReactReconcileTransaction|ReactServerRenderingTransaction} transaction
707
- */
708
- _setupTrapBubbledEventsLocal: function(transaction) {
709
- this._wrapperState = {
710
- listeners: null,
711
- };
712
- transaction.getReactMountReady().enqueue(trapBubbledEventsLocal, this);
713
- },
714
-
705
/**
706
* Creates markup for the open tag and all attributes.
707
*