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

Function isFallbackCompositionEnd

code/redux/public/app.js:3491–3508  ·  view source on GitHub ↗

* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}

(topLevelType, nativeEvent)

Source from the content-addressed store, hash-verified

3489 * @return {boolean}
3490 */
3491function isFallbackCompositionEnd(topLevelType, nativeEvent) {
3492 switch (topLevelType) {
3493 case 'topKeyUp':
3494 // Command keys insert or clear IME input.
3495 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
3496 case 'topKeyDown':
3497 // Expect IME keyCode on each keydown. If we get any other
3498 // code we must have exited earlier.
3499 return nativeEvent.keyCode !== START_KEYCODE;
3500 case 'topKeyPress':
3501 case 'topMouseDown':
3502 case 'topBlur':
3503 // Events are not possible without cancelling IME.
3504 return true;
3505 default:
3506 return false;
3507 }
3508}
3509
3510/**
3511 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected