2 * Created by onvelocity on 2/3/16.
5 export default function getEventPath(event
) {
9 if (event
.nativeEvent
&& event
.nativeEvent
.path
) {
10 return event
.nativeEvent
.path
;
12 // for browsers, like IE, that don't have event.path
13 let node
= event
.target
;
15 // Array.unshift means put the value on the top of the array
16 const addToPath
= (value
) => path
.unshift(value
);
17 // warn: some browsers set the root's parent to itself
18 while (node
&& node
!== node
.parentNode
) {
20 node
= node
.parentNode
;