MCPcopy Create free account
hub / github.com/microsoft/SandDance / isFallbackCompositionEnd

Function isFallbackCompositionEnd

docs/external/js/react-dom.development.js:8852–8872  ·  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

8850
8851
8852 function isFallbackCompositionEnd(topLevelType, nativeEvent) {
8853 switch (topLevelType) {
8854 case TOP_KEY_UP:
8855 // Command keys insert or clear IME input.
8856 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
8857
8858 case TOP_KEY_DOWN:
8859 // Expect IME keyCode on each keydown. If we get any other
8860 // code we must have exited earlier.
8861 return nativeEvent.keyCode !== START_KEYCODE;
8862
8863 case TOP_KEY_PRESS:
8864 case TOP_MOUSE_DOWN:
8865 case TOP_BLUR:
8866 // Events are not possible without cancelling IME.
8867 return true;
8868
8869 default:
8870 return false;
8871 }
8872 }
8873 /**
8874 * Google Input Tools provides composition data via a CustomEvent,
8875 * with the `data` property populated in the `detail` object. If this

Callers 2

extractCompositionEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected