summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-08-20 13:30:47 +0300
committerVaadin Code Review <review@vaadin.com>2013-08-20 12:47:50 +0000
commit7220ca8758e44ae84ae5c9ef0623dc9585f6d171 (patch)
tree0e7fca68a7ac22012c29a8662af9a0ad984fb065
parentb5a212a8c87a7370c385aeec22ea98a58fc7b051 (diff)
downloadvaadin-framework-7220ca8758e44ae84ae5c9ef0623dc9585f6d171.tar.gz
vaadin-framework-7220ca8758e44ae84ae5c9ef0623dc9585f6d171.zip
Fixed DragAndDropWrapper using wrong drop target in IE8 #12406
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
-rw-r--r--client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java4
-rw-r--r--uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html17
-rw-r--r--uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java4
3 files changed, 13 insertions, 12 deletions
diff --git a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java
index dd838fdeff..b4cf008a38 100644
--- a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java
+++ b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java
@@ -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();
diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html
index 1565e5eb96..50b66a3b68 100644
--- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html
+++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.html
@@ -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>
@@ -18,12 +17,12 @@
</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>
@@ -33,27 +32,27 @@
</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>
diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java
index fb7ed92967..02dc326ed8 100644
--- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java
+++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropDisable.java
@@ -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);