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 Feb 17, 2016
1 parent 4865ddf commit 2fdaba4
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 = 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 2fdaba4

Please sign in to comment.