MCPcopy Create free account
hub / github.com/Lucifier129/react-lite / getDataFromCustomEvent

Function getDataFromCustomEvent

examples/simple/react.js:249–255  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

247 * @return {?string}
248 */
249function getDataFromCustomEvent(nativeEvent) {
250 var detail = nativeEvent.detail;
251 if (typeof detail === 'object' && 'data' in detail) {
252 return detail.data;
253 }
254 return null;
255}
256
257// Track the current IME composition fallback object, if any.
258var currentComposition = null;

Callers 2

extractCompositionEventFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected