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

Function handleControlledInputBlur

code/composition/public/app.js:4982–4997  ·  view source on GitHub ↗
(inst, node)

Source from the content-addressed store, hash-verified

4980}
4981
4982function handleControlledInputBlur(inst, node) {
4983 // TODO: In IE, inst is occasionally null. Why?
4984 if (inst == null) {
4985 return;
4986 }
4987
4988 // Fiber and ReactDOM keep wrapper state in separate places
4989 var state = inst._wrapperState || node._wrapperState;
4990
4991 if (!state || !state.controlled || node.type !== 'number') {
4992 return;
4993 }
4994
4995 // If controlled, assign the value attribute to the current value on blur
4996 setDefaultValue(node, 'number', node.value);
4997}
4998
4999/**
5000 * 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