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

Function isFallbackCompositionEnd

code/styling/public/app.js:3240–3257  ·  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

3238 * @return {boolean}
3239 */
3240function isFallbackCompositionEnd(topLevelType, nativeEvent) {
3241 switch (topLevelType) {
3242 case 'topKeyUp':
3243 // Command keys insert or clear IME input.
3244 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
3245 case 'topKeyDown':
3246 // Expect IME keyCode on each keydown. If we get any other
3247 // code we must have exited earlier.
3248 return nativeEvent.keyCode !== START_KEYCODE;
3249 case 'topKeyPress':
3250 case 'topMouseDown':
3251 case 'topBlur':
3252 // Events are not possible without cancelling IME.
3253 return true;
3254 default:
3255 return false;
3256 }
3257}
3258
3259/**
3260 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected