mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Fix #4963 - SVG <use> swallows click events
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user