* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}
(topLevelType, nativeEvent)
| 219 | * @return {boolean} |
| 220 | */ |
| 221 | function isFallbackCompositionEnd(topLevelType, nativeEvent) { |
| 222 | switch (topLevelType) { |
| 223 | case topLevelTypes.topKeyUp: |
| 224 | // Command keys insert or clear IME input. |
| 225 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; |
| 226 | case topLevelTypes.topKeyDown: |
| 227 | // Expect IME keyCode on each keydown. If we get any other |
| 228 | // code we must have exited earlier. |
| 229 | return nativeEvent.keyCode !== START_KEYCODE; |
| 230 | case topLevelTypes.topKeyPress: |
| 231 | case topLevelTypes.topMouseDown: |
| 232 | case topLevelTypes.topBlur: |
| 233 | // Events are not possible without cancelling IME. |
| 234 | return true; |
| 235 | default: |
| 236 | return false; |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | /** |
| 241 | * Google Input Tools provides composition data via a CustomEvent, |
no outgoing calls
no test coverage detected