From 2a475b4bccc9e3b09d41e1f81469f750f21fbf30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Fri, 14 Dec 2012 16:28:24 +0200 Subject: [PATCH] Avoid attempting to use a DOM node as an element (#10480) Change-Id: I05023392ebe99635ebe1700b14e84a317f4d6cb8 --- .../src/com/vaadin/client/ui/dd/VDragAndDropManager.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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))) { -- 2.39.5