* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}
(topLevelType, nativeEvent)
| 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 |
no outgoing calls
no test coverage detected