From 3514c57b34f4906ad76fde9b26a34c9818b5d083 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Tue, 15 Dec 2015 15:59:55 +0200 Subject: Fix Grid column resize to take account min width for cells (#16597) Use Escalator cell size calculation without content to determine the absolute minimum size for cells. This is used in Grid when drag resizing or sorting columns to prevent cells from overflowing to the next row. Change-Id: I2d598232d7d2b8729b11fe190b68ca3e42ee3652 --- .../grid/basicfeatures/server/GridColumnResizeTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'uitest') diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java index a2417bb02f..5253e0fff9 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnResizeTest.java @@ -121,4 +121,14 @@ public class GridColumnResizeTest extends GridBasicFeaturesTest { cell.isElementPresent(By .cssSelector("div.v-grid-column-resize-handle"))); } + + @Test + public void testShrinkColumnToZero() { + openTestURL(); + GridCellElement cell = getGridElement().getCell(0, 1); + dragResizeColumn(1, 0, cell.getSize().getWidth()); + + assertGreaterOrEqual("Cell got too small.", cell.getSize().getWidth(), + 10); + } } -- cgit v1.2.3