MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / handleControlledInputBlur

Function handleControlledInputBlur

code/third-party/public/app.js:4077–4092  ·  view source on GitHub ↗
(inst, node)

Source from the content-addressed store, hash-verified

4075}
4076
4077function handleControlledInputBlur(inst, node) {
4078 // TODO: In IE, inst is occasionally null. Why?
4079 if (inst == null) {
4080 return;
4081 }
4082
4083 // Fiber and ReactDOM keep wrapper state in separate places
4084 var state = inst._wrapperState || node._wrapperState;
4085
4086 if (!state || !state.controlled || node.type !== 'number') {
4087 return;
4088 }
4089
4090 // If controlled, assign the value attribute to the current value on blur
4091 setDefaultValue(node, 'number', node.value);
4092}
4093
4094/**
4095 * This plugin creates an `onChange` event that normalizes change events

Callers 1

app.jsFile · 0.70

Calls 1

setDefaultValueFunction · 0.70

Tested by

no test coverage detected