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

Function isFallbackCompositionEnd

code/communication/public/app.js:3275–3292  ·  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

3273 * @return {boolean}
3274 */
3275function isFallbackCompositionEnd(topLevelType, nativeEvent) {
3276 switch (topLevelType) {
3277 case 'topKeyUp':
3278 // Command keys insert or clear IME input.
3279 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
3280 case 'topKeyDown':
3281 // Expect IME keyCode on each keydown. If we get any other
3282 // code we must have exited earlier.
3283 return nativeEvent.keyCode !== START_KEYCODE;
3284 case 'topKeyPress':
3285 case 'topMouseDown':
3286 case 'topBlur':
3287 // Events are not possible without cancelling IME.
3288 return true;
3289 default:
3290 return false;
3291 }
3292}
3293
3294/**
3295 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected