summaryrefslogtreecommitdiffstats
path: root/uitest
diff options
context:
space:
mode:
authorPekka Hyvönen <pekka@vaadin.com>2017-05-18 14:11:03 +0300
committerGitHub <noreply@github.com>2017-05-18 14:11:03 +0300
commit88429109c2f8e77fb3a9ef7b5ab51d51e7dcaa58 (patch)
treec2743e0febb57817f7137cbbe7a1e896e277ef23 /uitest
parent548650bfe02f6e2582f06cecee2333099d951718 (diff)
downloadvaadin-framework-88429109c2f8e77fb3a9ef7b5ab51d51e7dcaa58.tar.gz
vaadin-framework-88429109c2f8e77fb3a9ef7b5ab51d51e7dcaa58.zip
Show drop hints when dropping in empty Grid (#9353)
Also makes sure that the drop location and target row return something sensible in drop event. Clarifies docs on drop location.
Diffstat (limited to 'uitest')
-rw-r--r--uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java
index ad13e2177a..fedae64e7d 100644
--- a/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java
+++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridDragAndDrop.java
@@ -61,6 +61,7 @@ public class GridDragAndDrop extends AbstractTestUIWithLog {
// Layout the two grids
Layout grids = new HorizontalLayout();
grids.addComponents(left, right);
+ grids.setWidth("100%");
// Selection modes
List<Grid.SelectionMode> selectionModes = Arrays
@@ -87,6 +88,7 @@ public class GridDragAndDrop extends AbstractTestUIWithLog {
private Grid<Person> createGridAndFillWithData(int numberOfItems) {
Grid<Person> grid = new Grid<>();
+ grid.setWidth("100%");
grid.setItems(generateItems(numberOfItems));
grid.addColumn(
@@ -162,7 +164,7 @@ public class GridDragAndDrop extends AbstractTestUIWithLog {
if (event.getDropTargetRow().isPresent()) {
index = items.indexOf(event.getDropTargetRow().get())
+ (event.getDropLocation() == DropLocation.BELOW
- ? 1 : 0);
+ ? 1 : 0);
}
// Add dragged items to the target Grid
@@ -173,10 +175,12 @@ public class GridDragAndDrop extends AbstractTestUIWithLog {
+ ", dragDataJson="
+ event.getDataTransferData("application/json")
+ ", target="
- + (event.getDropTargetRow().isPresent() ?
- event.getDropTargetRow().get().getFirstName() + " "
+ + (event.getDropTargetRow().isPresent() ? event
+ .getDropTargetRow().get().getFirstName()
+ + " "
+ event.getDropTargetRow().get()
- .getLastName() : "[BODY]")
+ .getLastName()
+ : "[BODY]")
+ ", location=" + event.getDropLocation());
}
});