Skip to content

Commit

Permalink
Fix facebook#4963 - SVG <use> swallows click events
Browse files Browse the repository at this point in the history
  • Loading branch information
edmellum committed Dec 18, 2015
1 parent 83328d4 commit d8c956b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/renderers/dom/client/utils/getEventTarget.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;

if (!target.nodeType) {
target = target.correspondingUseElement;
}

// Safari may fire events on text nodes (Node.TEXT_NODE is 3).
// @see http://www.quirksmode.org/js/events_properties.html
return target.nodeType === 3 ? target.parentNode : target;
Expand Down

0 comments on commit d8c956b

Please sign in to comment.