* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}
(topLevelType, nativeEvent)
| 3489 | * @return {boolean} |
| 3490 | */ |
| 3491 | function isFallbackCompositionEnd(topLevelType, nativeEvent) { |
| 3492 | switch (topLevelType) { |
| 3493 | case 'topKeyUp': |
| 3494 | // Command keys insert or clear IME input. |
| 3495 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; |
| 3496 | case 'topKeyDown': |
| 3497 | // Expect IME keyCode on each keydown. If we get any other |
| 3498 | // code we must have exited earlier. |
| 3499 | return nativeEvent.keyCode !== START_KEYCODE; |
| 3500 | case 'topKeyPress': |
| 3501 | case 'topMouseDown': |
| 3502 | case 'topBlur': |
| 3503 | // Events are not possible without cancelling IME. |
| 3504 | return true; |
| 3505 | default: |
| 3506 | return false; |
| 3507 | } |
| 3508 | } |
| 3509 | |
| 3510 | /** |
| 3511 | * Google Input Tools provides composition data via a CustomEvent, |
no outgoing calls
no test coverage detected