MCPcopy Create free account
hub / github.com/Lobos/react-ui / getTargetInstForInputEventIE

Function getTargetInstForInputEventIE

docs/lib/react.js:1117–1134  ·  view source on GitHub ↗
(topLevelType, targetInst)

Source from the content-addressed store, hash-verified

1115
1116// For IE8 and IE9.
1117function getTargetInstForInputEventIE(topLevelType, targetInst) {
1118 if (topLevelType === topLevelTypes.topSelectionChange || topLevelType === topLevelTypes.topKeyUp || topLevelType === topLevelTypes.topKeyDown) {
1119 // On the selectionchange event, the target is just document which isn't
1120 // helpful for us so just check activeElement instead.
1121 //
1122 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
1123 // propertychange on the first input event after setting `value` from a
1124 // script and fires only keydown, keypress, keyup. Catching keyup usually
1125 // gets it and catching keydown lets us fire an event for the first
1126 // keystroke if user does a key repeat (it'll be a little delayed: right
1127 // before the second keystroke). Other input methods (e.g., paste) seem to
1128 // fire selectionchange normally.
1129 if (activeElement && activeElement.value !== activeElementValue) {
1130 activeElementValue = activeElement.value;
1131 return activeElementInst;
1132 }
1133 }
1134}
1135
1136/**
1137 * SECTION: handle `click` event

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…