* Google Input Tools provides composition data via a CustomEvent, * with the `data` property populated in the `detail` object. If this * is available on the event object, use it. If not, this is a plain * composition event and we have nothing special to extract. * * @param {object} nativeEvent
(nativeEvent)
| 2627 | * @return {?string} |
| 2628 | */ |
| 2629 | function getDataFromCustomEvent(nativeEvent) { |
| 2630 | var detail = nativeEvent.detail; |
| 2631 | if (typeof detail === 'object' && 'data' in detail) { |
| 2632 | return detail.data; |
| 2633 | } |
| 2634 | return null; |
| 2635 | } |
| 2636 | |
| 2637 | // Track the current IME composition status, if any. |
| 2638 | var isComposing = false; |
no outgoing calls
no test coverage detected