From d015f1c21054855d104b36bf00bb87c266905766 Mon Sep 17 00:00:00 2001 From: Taye Adeyemi Date: Mon, 29 Dec 2014 13:15:13 +0000 Subject: [PATCH] Use event.path[0] to get event target if avilable --- interact.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/interact.js b/interact.js index 53942466c..a440fc9df 100644 --- a/interact.js +++ b/interact.js @@ -3068,7 +3068,9 @@ function doOnInteractions (method) { return (function (event) { var interaction, - eventTarget = getActualElement(event.target), + eventTarget = getActualElement(event.path + ? event.path[0] + : event.target), curEventTarget = getActualElement(event.currentTarget), i; @@ -3456,7 +3458,10 @@ function delegateListener (event, useCapture) { var fakeEvent = {}, delegated = delegatedEvents[event.type], - element = event.target; + eventTarget = getActualElement(event.path + ? event.path[0] + : event.target), + element = eventTarget; useCapture = useCapture? true: false; @@ -3475,7 +3480,7 @@ context = delegated.contexts[i]; if (matchesSelector(element, selector) - && nodeContains(context, event.target) + && nodeContains(context, eventTarget) && nodeContains(context, element)) { var listeners = delegated.listeners[i];