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

Function getTargetInstForInputEventPolyfill

code/redux/public/app.js:5056–5070  ·  view source on GitHub ↗
(topLevelType, targetInst)

Source from the content-addressed store, hash-verified

5054
5055// For IE8 and IE9.
5056function getTargetInstForInputEventPolyfill(topLevelType, targetInst) {
5057 if (topLevelType === 'topSelectionChange' || topLevelType === 'topKeyUp' || topLevelType === 'topKeyDown') {
5058 // On the selectionchange event, the target is just document which isn't
5059 // helpful for us so just check activeElement instead.
5060 //
5061 // 99% of the time, keydown and keyup aren't necessary. IE8 fails to fire
5062 // propertychange on the first input event after setting `value` from a
5063 // script and fires only keydown, keypress, keyup. Catching keyup usually
5064 // gets it and catching keydown lets us fire an event for the first
5065 // keystroke if user does a key repeat (it'll be a little delayed: right
5066 // before the second keystroke). Other input methods (e.g., paste) seem to
5067 // fire selectionchange normally.
5068 return getInstIfValueChanged(activeElementInst);
5069 }
5070}
5071
5072/**
5073 * SECTION: handle `click` event

Callers

nothing calls this directly

Calls 1

getInstIfValueChangedFunction · 0.70

Tested by

no test coverage detected