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 c5c079a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 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,9 @@
*/
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 c5c079a

Please sign in to comment.