From: Leif Åstrand Date: Fri, 14 Dec 2012 14:28:24 +0000 (+0200) Subject: Avoid attempting to use a DOM node as an element (#10480) X-Git-Tag: 7.0.0.beta11~30^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=refs%2Fchanges%2F11%2F511%2F1;p=vaadin-framework.git Avoid attempting to use a DOM node as an element (#10480) Change-Id: I05023392ebe99635ebe1700b14e84a317f4d6cb8 --- diff --git a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java index ae14218fff..ac1ae72877 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java +++ b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java @@ -84,7 +84,14 @@ public class VDragAndDropManager { currentDrag.setCurrentGwtEvent(nativeEvent); updateDragImagePosition(); - Element targetElement = Element.as(nativeEvent.getEventTarget()); + Node targetNode = Node.as(nativeEvent.getEventTarget()); + Element targetElement; + if (Element.is(targetNode)) { + targetElement = Element.as(targetNode); + } else { + targetElement = targetNode.getParentElement(); + } + if (Util.isTouchEvent(nativeEvent) || (dragElement != null && dragElement .isOrHasChild(targetElement))) {