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

Function handleControlledInputBlur

code/communication/public/app.js:4879–4894  ·  view source on GitHub ↗
(inst, node)

Source from the content-addressed store, hash-verified

4877}
4878
4879function handleControlledInputBlur(inst, node) {
4880 // TODO: In IE, inst is occasionally null. Why?
4881 if (inst == null) {
4882 return;
4883 }
4884
4885 // Fiber and ReactDOM keep wrapper state in separate places
4886 var state = inst._wrapperState || node._wrapperState;
4887
4888 if (!state || !state.controlled || node.type !== 'number') {
4889 return;
4890 }
4891
4892 // If controlled, assign the value attribute to the current value on blur
4893 setDefaultValue(node, 'number', node.value);
4894}
4895
4896/**
4897 * 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