* Does our fallback mode think that this event is the end of composition? * * @param {string} topLevelType * @param {object} nativeEvent * @return {boolean}
(topLevelType, nativeEvent)
| 3238 | * @return {boolean} |
| 3239 | */ |
| 3240 | function isFallbackCompositionEnd(topLevelType, nativeEvent) { |
| 3241 | switch (topLevelType) { |
| 3242 | case 'topKeyUp': |
| 3243 | // Command keys insert or clear IME input. |
| 3244 | return END_KEYCODES.indexOf(nativeEvent.keyCode) !== -1; |
| 3245 | case 'topKeyDown': |
| 3246 | // Expect IME keyCode on each keydown. If we get any other |
| 3247 | // code we must have exited earlier. |
| 3248 | return nativeEvent.keyCode !== START_KEYCODE; |
| 3249 | case 'topKeyPress': |
| 3250 | case 'topMouseDown': |
| 3251 | case 'topBlur': |
| 3252 | // Events are not possible without cancelling IME. |
| 3253 | return true; |
| 3254 | default: |
| 3255 | return false; |
| 3256 | } |
| 3257 | } |
| 3258 | |
| 3259 | /** |
| 3260 | * Google Input Tools provides composition data via a CustomEvent, |
no outgoing calls
no test coverage detected