MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / isFallbackCompositionEnd

Function isFallbackCompositionEnd

code/composition/public/app.js:3378–3395  ·  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

3376 * @return {boolean}
3377 */
3378function isFallbackCompositionEnd(topLevelType, nativeEvent) {
3379 switch (topLevelType) {
3380 case 'topKeyUp':
3381 // Command keys insert or clear IME input.
3382 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
3383 case 'topKeyDown':
3384 // Expect IME keyCode on each keydown. If we get any other
3385 // code we must have exited earlier.
3386 return nativeEvent.keyCode !== START_KEYCODE;
3387 case 'topKeyPress':
3388 case 'topMouseDown':
3389 case 'topBlur':
3390 // Events are not possible without cancelling IME.
3391 return true;
3392 default:
3393 return false;
3394 }
3395}
3396
3397/**
3398 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected