* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}
(topLevelType, nativeEvent)
| 3376 | * @return {boolean} |
| 3377 | */ |
| 3378 | function isFallbackCompositionEnd(topLevelType, nativeEvent) { |
| 3379 | switch (topLevelType) { |
| 3380 | case 'topKeyUp': |
| 3381 | // Command keys insert or clear IME input. |
| 3382 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; |
| 3383 | case 'topKeyDown': |
| 3384 | // Expect IME keyCode on each keydown. If we get any other |
| 3385 | // code we must have exited earlier. |
| 3386 | return nativeEvent.keyCode !== START_KEYCODE; |
| 3387 | case 'topKeyPress': |
| 3388 | case 'topMouseDown': |
| 3389 | case 'topBlur': |
| 3390 | // Events are not possible without cancelling IME. |
| 3391 | return true; |
| 3392 | default: |
| 3393 | return false; |
| 3394 | } |
| 3395 | } |
| 3396 | |
| 3397 | /** |
| 3398 | * Google Input Tools provides composition data via a CustomEvent, |
no outgoing calls
no test coverage detected