MCPcopy Create free account
hub / github.com/Lobos/react-ui / isFallbackCompositionEnd

Function isFallbackCompositionEnd

docs/lib/react.js:168–185  ·  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

166 * @return {boolean}
167 */
168function isFallbackCompositionEnd(topLevelType, nativeEvent) {
169 switch (topLevelType) {
170 case topLevelTypes.topKeyUp:
171 // Command keys insert or clear IME input.
172 return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1;
173 case topLevelTypes.topKeyDown:
174 // Expect IME keyCode on each keydown. If we get any other
175 // code we must have exited earlier.
176 return nativeEvent.keyCode !== START_KEYCODE;
177 case topLevelTypes.topKeyPress:
178 case topLevelTypes.topMouseDown:
179 case topLevelTypes.topBlur:
180 // Events are not possible without cancelling IME.
181 return true;
182 default:
183 return false;
184 }
185}
186
187/**
188 * Google Input Tools provides composition data via a CustomEvent,

Callers 2

extractCompositionEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…