Skip to content

Commit

Permalink
Fix #4963 - SVG <use> swallows click events
Browse files Browse the repository at this point in the history
  • Loading branch information
edmellum committed Dec 23, 2015
1 parent 83328d4 commit 39b62a9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 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,12 @@
*/
function getEventTarget(nativeEvent) {
var target = nativeEvent.target || nativeEvent.srcElement || window;

// Normalize SVG <use> element events #4963
if (target.correspondingUseElement && !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 39b62a9

Please sign in to comment.