@@ -71,13 +71,6 @@ function shouldUseChangeEvent(elem) {
71
71
( nodeName === 'input' && elem . type === 'file' ) ;
72
72
}
73
73
74
- var doesChangeEventBubble = false ;
75
- if ( ExecutionEnvironment . canUseDOM ) {
76
- // See `handleChange` comment below
77
- doesChangeEventBubble = isEventSupported ( 'change' ) &&
78
- ( ! document . documentMode || document . documentMode > 8 ) ;
79
- }
80
-
81
74
function manualDispatchChangeEvent ( nativeEvent ) {
82
75
var event = createAndAccumulateChangeEvent (
83
76
activeElementInst ,
@@ -104,21 +97,6 @@ function runEventInBatch(event) {
104
97
EventPluginHub . processEventQueue ( false ) ;
105
98
}
106
99
107
- function startWatchingForChangeEventIE8 ( target , targetInst ) {
108
- activeElement = target ;
109
- activeElementInst = targetInst ;
110
- activeElement . attachEvent ( 'onchange' , manualDispatchChangeEvent ) ;
111
- }
112
-
113
- function stopWatchingForChangeEventIE8 ( ) {
114
- if ( ! activeElement ) {
115
- return ;
116
- }
117
- activeElement . detachEvent ( 'onchange' , manualDispatchChangeEvent ) ;
118
- activeElement = null ;
119
- activeElementInst = null ;
120
- }
121
-
122
100
function getInstIfValueChanged ( targetInst ) {
123
101
if ( inputValueTracking . updateValueIfChanged ( targetInst ) ) {
124
102
return targetInst ;
@@ -131,17 +109,6 @@ function getTargetInstForChangeEvent(topLevelType, targetInst) {
131
109
}
132
110
}
133
111
134
- function handleEventsForChangeEventIE8 ( topLevelType , target , targetInst ) {
135
- if ( topLevelType === 'topFocus' ) {
136
- // stopWatching() should be a noop here but we call it just in case we
137
- // missed a blur event somehow.
138
- stopWatchingForChangeEventIE8 ( ) ;
139
- startWatchingForChangeEventIE8 ( target , targetInst ) ;
140
- } else if ( topLevelType === 'topBlur' ) {
141
- stopWatchingForChangeEventIE8 ( ) ;
142
- }
143
- }
144
-
145
112
/**
146
113
* SECTION: handle `input` event
147
114
*/
@@ -192,9 +159,6 @@ function handlePropertyChange(nativeEvent) {
192
159
193
160
function handleEventsForInputEventPolyfill ( topLevelType , target , targetInst ) {
194
161
if ( topLevelType === 'topFocus' ) {
195
- // In IE8, we can capture almost all .value changes by adding a
196
- // propertychange handler and looking for events with propertyName
197
- // equal to 'value'
198
162
// In IE9, propertychange fires for most input events but is buggy and
199
163
// doesn't fire when text is deleted, but conveniently, selectionchange
200
164
// appears to fire in all of the remaining cases so we catch those and
@@ -305,11 +269,7 @@ var ChangeEventPlugin = {
305
269
306
270
var getTargetInstFunc , handleEventFunc ;
307
271
if ( shouldUseChangeEvent ( targetNode ) ) {
308
- if ( doesChangeEventBubble ) {
309
- getTargetInstFunc = getTargetInstForChangeEvent ;
310
- } else {
311
- handleEventFunc = handleEventsForChangeEventIE8 ;
312
- }
272
+ getTargetInstFunc = getTargetInstForChangeEvent ;
313
273
} else if ( isTextInputElement ( targetNode ) ) {
314
274
if ( isInputEventSupported ) {
315
275
getTargetInstFunc = getTargetInstForInputOrChangeEvent ;
0 commit comments