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

Function handleControlledInputBlur

code/styling/public/app.js:4844–4859  ·  view source on GitHub ↗
(inst, node)

Source from the content-addressed store, hash-verified

4842}
4843
4844function handleControlledInputBlur(inst, node) {
4845 // TODO: In IE, inst is occasionally null. Why?
4846 if (inst == null) {
4847 return;
4848 }
4849
4850 // Fiber and ReactDOM keep wrapper state in separate places
4851 var state = inst._wrapperState || node._wrapperState;
4852
4853 if (!state || !state.controlled || node.type !== 'number') {
4854 return;
4855 }
4856
4857 // If controlled, assign the value attribute to the current value on blur
4858 setDefaultValue(node, 'number', node.value);
4859}
4860
4861/**
4862 * 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