]> source.dussan.org Git - vaadin-framework.git/commitdiff
Avoid attempting to use a DOM node as an element (#10480) 11/511/1
authorLeif Åstrand <leif@vaadin.com>
Fri, 14 Dec 2012 14:28:24 +0000 (16:28 +0200)
committerLeif Åstrand <leif@vaadin.com>
Fri, 14 Dec 2012 14:28:24 +0000 (16:28 +0200)
Change-Id: I05023392ebe99635ebe1700b14e84a317f4d6cb8

client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java

index ae14218fff34aec5086510764cb68122482a4d4b..ac1ae72877e19a71f8d7371a6f554ed7d1286a8c 100644 (file)
@@ -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))) {