MCPcopy Create free account
hub / github.com/Lobos/react-ui / getEventTarget

Function getEventTarget

docs/lib/react.js:16766–16777  ·  view source on GitHub ↗

* Gets the target node from a native browser event by accounting for * inconsistencies in browser DOM APIs. * * @param {object} nativeEvent Native browser event. * @return {DOMEventTarget} Target node.

(nativeEvent)

Source from the content-addressed store, hash-verified

16764 */
16765
16766function getEventTarget(nativeEvent) {
16767 var target = nativeEvent.target || nativeEvent.srcElement || window;
16768
16769 // Normalize SVG <use> element events #4963
16770 if (target.correspondingUseElement) {
16771 target = target.correspondingUseElement;
16772 }
16773
16774 // Safari may fire events on text nodes (Node.TEXT_NODE is 3).
16775 // @see http://www.quirksmode.org/js/events_properties.html
16776 return target.nodeType === 3 ? target.parentNode : target;
16777}
16778
16779module.exports = getEventTarget;
16780},{}],125:[function(_dereq_,module,exports){

Callers 3

handleTopLevelImplFunction · 0.85
react.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…