diff options
author | Johannes Dahlström <johannesd@vaadin.com> | 2015-10-22 19:00:16 +0300 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2015-10-28 11:34:45 +0000 |
commit | ac1c4409539d605109078f3da27573c0f5769c10 (patch) | |
tree | f63734e38929a22c4a227caad1ae45d73a3822d6 | |
parent | fb28652b033bc500c114c65d84f418b6249befa4 (diff) | |
download | vaadin-framework-ac1c4409539d605109078f3da27573c0f5769c10.tar.gz vaadin-framework-ac1c4409539d605109078f3da27573c0f5769c10.zip |
Let column resize handle overflow its parent (#16838)
Change-Id: I795956a4512f1e6e688e1e3c0522cc952117d78f
4 files changed, 26 insertions, 12 deletions
diff --git a/WebContent/VAADIN/themes/base/grid/grid.scss b/WebContent/VAADIN/themes/base/grid/grid.scss index 5ae62940f4..6dc5f50cb1 100644 --- a/WebContent/VAADIN/themes/base/grid/grid.scss +++ b/WebContent/VAADIN/themes/base/grid/grid.scss @@ -262,10 +262,10 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co .#{$primaryStyleName}-column-resize-handle { position: absolute; - width: 20px; + width: 12px; top: 0px; bottom: 0px; - right: -10px; + right: -6px; cursor: col-resize; z-index: 10; } @@ -288,7 +288,14 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co } } - // Header and footer content + // Header and footer + + .#{$primaryStyleName}-header, + .#{$primaryStyleName}-footer { + .#{$primaryStyleName}-cell { + overflow: visible; + } + } .#{$primaryStyleName}-column-header-content, .#{$primaryStyleName}-column-footer-content { diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java index 3ccca105de..6eb6d95643 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java @@ -334,18 +334,18 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest { GridCellElement draggedHeaderCell = getGridElement() .getHeaderCell(0, 1); final int xOffset = 500; - new Actions(getDriver()).moveToElement(draggedHeaderCell, 5, 5) + new Actions(getDriver()).moveToElement(draggedHeaderCell, 10, 10) .clickAndHold().moveByOffset(xOffset, 0).build().perform(); WebElement floatingDragElement = findElement(By .className("dragged-column-header")); - int expectedLeft = draggedHeaderCell.getLocation().getX() + xOffset + 5 - - (floatingDragElement.getSize().getWidth() / 2); + int expectedLeft = draggedHeaderCell.getLocation().getX() + xOffset + + 10 - (floatingDragElement.getSize().getWidth() / 2); int realLeft = floatingDragElement.getLocation().getX(); assertTrue("Dragged element location wrong, expected " + expectedLeft - + " was " + realLeft, Math.abs(expectedLeft - realLeft) < 5); + + " was " + realLeft, Math.abs(expectedLeft - realLeft) < 10); } @Test 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 4345cc6f07..a2417bb02f 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 @@ -79,7 +79,14 @@ public class GridColumnResizeTest extends GridBasicFeaturesTest { @Test public void testResizeFirstColumn() { - dragResizeColumn(0, -10); + dragResizeColumn(0, -1, -10); + assertTrue("Log should contain a resize event", + logContainsText("ColumnResizeEvent: isUserOriginated? true")); + } + + @Test + public void testDragHandleStraddlesColumns() { + dragResizeColumn(0, 4, -10); assertTrue("Log should contain a resize event", logContainsText("ColumnResizeEvent: isUserOriginated? true")); } @@ -87,19 +94,19 @@ public class GridColumnResizeTest extends GridBasicFeaturesTest { @Test public void testColumnPixelSizesSetOnResize() { selectMenuPath("Component", "Columns", "All columns auto width"); - dragResizeColumn(0, -10); + dragResizeColumn(0, -1, -10); for (String msg : getLogs()) { assertTrue("Log should contain a resize event", msg.contains("ColumnResizeEvent: isUserOriginated? true")); } } - private void dragResizeColumn(int columnIndex, int offset) { + private void dragResizeColumn(int columnIndex, int posX, int offset) { GridCellElement headerCell = getGridElement().getHeaderCell(0, columnIndex); Dimension size = headerCell.getSize(); new Actions(getDriver()) - .moveToElement(headerCell, size.getWidth() - 1, + .moveToElement(headerCell, size.getWidth() + posX, size.getHeight() / 2).clickAndHold() .moveByOffset(offset, 0).release().perform(); } diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSortingTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSortingTest.java index b471612798..548e8dbd2f 100644 --- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSortingTest.java +++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridSortingTest.java @@ -196,7 +196,7 @@ public class GridSortingTest extends GridBasicFeaturesTest { } private void clickHeader(GridCellElement headerCell) { - new Actions(getDriver()).moveToElement(headerCell, 5, 5).click() + new Actions(getDriver()).moveToElement(headerCell, 10, 10).click() .perform(); } |