]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed DragAndDropWrapper using wrong drop target in IE8 #12406
authorJohn Ahlroos <john@vaadin.com>
Tue, 20 Aug 2013 10:30:47 +0000 (13:30 +0300)
committerVaadin Code Review <review@vaadin.com>
Tue, 20 Aug 2013 12:47:50 +0000 (12:47 +0000)
VDragAndDropManager was assuming that the target element will always be
inside the cloned "drag image" element while dragging. This assumption
is false since the "drag image" can be 0x0px or transparent effectivly
disabling dragging.

Since Testbench 2 is also very flaky in using the Vaadin locators with
the drag/drop commands I replaced the locators with shorter locators
using a debug id to make the test more readable and stable.

Change-Id: I2cc9683d11e982521e74418c74dd3e81ee617ac5

client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java
uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html
uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java

index dd838fdeff23b33d46548a166db2bc4a98dfdff2..b4cf008a38f6b4ebd3c29422362201ffc5fb3258 100644 (file)
@@ -93,9 +93,7 @@ public class VDragAndDropManager {
                 targetElement = targetNode.getParentElement();
             }
 
-            if (Util.isTouchEvent(nativeEvent)
-                    || (dragElement != null && dragElement
-                            .isOrHasChild(targetElement))) {
+            if (Util.isTouchEvent(nativeEvent) || dragElement != null) {
                 // to detect the "real" target, hide dragelement temporary and
                 // use elementFromPoint
                 String display = dragElement.getStyle().getDisplay();
index 1565e5eb968d98ee96435b021f4cd0f41976cfa8..50b66a3b68eef3aee6a5303562e6e8a0f549c3aa 100644 (file)
@@ -3,7 +3,6 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head profile="http://selenium-ide.openqa.org/profiles/test-case">
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="http://localhost:8888/" />
 <title>DragAndDropDisable</title>
 </head>        
 <body>
 </tr>
 <tr>
        <td>drag</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-2</td>
        <td>18,25</td>
 </tr>
 <tr>
        <td>drop</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-1</td>
        <td>34,51</td>
 </tr>
 <tr>
 </tr>
 <tr>
        <td>drag</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-2</td>
        <td>20,32</td>
 </tr>
 <tr>
        <td>drop</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-1</td>
        <td>37,59</td>
 </tr>
 <tr>
        <td>drag</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VLabel[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-1/VLabel[0]</td>
        <td>59,10</td>
 </tr>
 <tr>
        <td>drop</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-2</td>
        <td>68,15</td>
 </tr>
 <tr>
        <td>mouseClick</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]/VLabel[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-1/VLabel[0]</td>
        <td>68,160</td>
 </tr>
 <tr>
@@ -63,7 +62,7 @@
 </tr>
 <tr>
        <td>drop</td>
-       <td>vaadin=runDragAndDropDisable::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VPanel[0]/VDragAndDropWrapper[0]/VCssLayout[0]</td>
+       <td>vaadin=runDragAndDropDisable::PID_Scsslayout-1</td>
        <td>118,50</td>
 </tr>
 <tr>
index fb7ed929674795717f2dceacaee31281ff296252..02dc326ed8ea8796783a3e327113a0355ef50d31 100644 (file)
@@ -31,9 +31,11 @@ public class DragAndDropDisable extends AbstractTestUI {
             addComponent(p);
 
             final CssLayout layout = new CssLayout();
+            layout.setId("csslayout-1");
             layout.setHeight("100px");
 
             final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
+            dnd.setId("ddwrapper-1");
             p.setContent(dnd);
 
             final CheckBox enabled = new CheckBox("Enabled", true);
@@ -68,9 +70,11 @@ public class DragAndDropDisable extends AbstractTestUI {
             addComponent(p);
 
             final CssLayout layout = new CssLayout();
+            layout.setId("csslayout-2");
             layout.setHeight("100px");
 
             final DragAndDropWrapper dnd = new DragAndDropWrapper(layout);
+            dnd.setId("ddwrapper-2");
             p.setContent(dnd);
 
             final CheckBox enabled = new CheckBox("Enabled", true);