diff options
author | Anna Koskinen <Ansku@users.noreply.github.com> | 2018-03-20 14:13:27 +0200 |
---|---|---|
committer | Ilia Motornyi <elmot@vaadin.com> | 2018-03-20 14:13:27 +0200 |
commit | 31eba3b64bdeab39d5fcf666535a1441e2ff6b1b (patch) | |
tree | d331e6d731a929e5e63cef0185c503b82884cc65 /uitest | |
parent | 9cf87e1423b1c4e0358112615433bbbf2bc47da3 (diff) | |
download | vaadin-framework-31eba3b64bdeab39d5fcf666535a1441e2ff6b1b.tar.gz vaadin-framework-31eba3b64bdeab39d5fcf666535a1441e2ff6b1b.zip |
Scroll the parent if Grid has already scrolled to the end (#10700)
Fixes #9477
Diffstat (limited to 'uitest')
-rw-r--r-- | uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollOuterLayoutAfterContents.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollOuterLayoutAfterContents.java b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollOuterLayoutAfterContents.java new file mode 100644 index 0000000000..3a7d9b19fd --- /dev/null +++ b/uitest/src/main/java/com/vaadin/tests/components/grid/GridScrollOuterLayoutAfterContents.java @@ -0,0 +1,52 @@ +package com.vaadin.tests.components.grid; + +import java.util.stream.IntStream; + +import com.vaadin.annotations.Widgetset; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.grid.HeightMode; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Grid; +import com.vaadin.ui.Panel; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.VerticalLayout; + +@Widgetset("com.vaadin.DefaultWidgetSet") +public class GridScrollOuterLayoutAfterContents extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Grid<Integer> grid = new Grid<>(); + + // create column and fill rows + grid.addColumn(item -> "name" + item).setCaption("Name"); + grid.addColumn(item -> "content" + item).setCaption("Content"); + grid.setItems(IntStream.range(1, 21).boxed()); + + // set height mode and height + grid.setHeightMode(HeightMode.ROW); + grid.setHeightByRows(10); + + VerticalLayout layout = new VerticalLayout(grid, new TextArea()); + layout.setSpacing(true); + layout.setMargin(false); + layout.setSizeUndefined(); + + Panel panel = new Panel(); + panel.setContent(layout); + panel.setHeight("200px"); + panel.setWidthUndefined(); + + addComponent(panel); + } + + @Override + protected String getTestDescription() { + return "Should be possible to scroll to the TextArea underneath the Grid even on mobile"; + } + + @Override + protected Integer getTicketNumber() { + return 9477; + } +} |