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

Function isFallbackCompositionEnd

code/third-party/public/app.js:2473–2490  ·  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

2471 * @return {boolean}
2472 */
2473function isFallbackCompositionEnd(topLevelType, nativeEvent) {
2474 switch (topLevelType) {
2475 case 'topKeyUp':
2476 // Command keys insert or clear IME input.
2477 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
2478 case 'topKeyDown':
2479 // Expect IME keyCode on each keydown. If we get any other
2480 // code we must have exited earlier.
2481 return nativeEvent.keyCode !== START_KEYCODE;
2482 case 'topKeyPress':
2483 case 'topMouseDown':
2484 case 'topBlur':
2485 // Events are not possible without cancelling IME.
2486 return true;
2487 default:
2488 return false;
2489 }
2490}
2491
2492/**
2493 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected