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

Function handleControlledInputBlur

code/new-context-api/public/app.js:4205–4220  ·  view source on GitHub ↗
(inst, node)

Source from the content-addressed store, hash-verified

4203}
4204
4205function handleControlledInputBlur(inst, node) {
4206 // TODO: In IE, inst is occasionally null. Why?
4207 if (inst == null) {
4208 return;
4209 }
4210
4211 // Fiber and ReactDOM keep wrapper state in separate places
4212 var state = inst._wrapperState || node._wrapperState;
4213
4214 if (!state || !state.controlled || node.type !== 'number') {
4215 return;
4216 }
4217
4218 // If controlled, assign the value attribute to the current value on blur
4219 setDefaultValue(node, 'number', node.value);
4220}
4221
4222/**
4223 * 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