Remove old reference to inst._wrapperState (#12987)
This commit removes a reference to inst._wrapperState, which was the old way of tracking input state in the stack renderer. This means we no longer need to pass the instance into the associated function, allowing us to eliminate an exception for IE (and a TODO).
This commit is contained in:
parent
c78957eac8
commit
d0d4280640
|
@ -231,14 +231,8 @@ function getTargetInstForInputOrChangeEvent(topLevelType, targetInst) {
|
|||
}
|
||||
}
|
||||
|
||||
function handleControlledInputBlur(inst, node) {
|
||||
// TODO: In IE, inst is occasionally null. Why?
|
||||
if (inst == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Fiber and ReactDOM keep wrapper state in separate places
|
||||
let state = inst._wrapperState || node._wrapperState;
|
||||
function handleControlledInputBlur(node) {
|
||||
let state = node._wrapperState;
|
||||
|
||||
if (!state || !state.controlled || node.type !== 'number') {
|
||||
return;
|
||||
|
@ -303,7 +297,7 @@ const ChangeEventPlugin = {
|
|||
|
||||
// When blurring, set the value attribute for number inputs
|
||||
if (topLevelType === TOP_BLUR) {
|
||||
handleControlledInputBlur(targetInst, targetNode);
|
||||
handleControlledInputBlur(targetNode);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue