From 1695c1a6bd98328ce397e7ed63b9cb770ecb32eb Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Mon, 21 Sep 2015 11:10:43 +0300 Subject: Fix Grid internal focus tracking with Editor open (#18956) Change-Id: I92b9f632960c041111ae9aada6055eab14a9bd81 --- client/src/com/vaadin/client/widgets/Grid.java | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'client') diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java index 5dc8583423..6457200dd2 100644 --- a/client/src/com/vaadin/client/widgets/Grid.java +++ b/client/src/com/vaadin/client/widgets/Grid.java @@ -1360,6 +1360,11 @@ public class Grid extends ResizeComposite implements rowIndex = request.getRowIndex(); focusedColumnIndex = request.getColumnIndex(); + if (focusedColumnIndex >= 0) { + // Update internal focus of Grid + grid.focusCell(rowIndex, focusedColumnIndex); + } + showOverlay(); } } @@ -1508,11 +1513,13 @@ public class Grid extends ResizeComposite implements } if (this.rowIndex == rowIndex) { - if (focusedColumnIndex != columnIndex - && columnIndex >= grid.getFrozenColumnCount()) { - // Scroll to new focused column. - grid.getEscalator().scrollToColumn(columnIndex, - ScrollDestination.ANY, 0); + if (focusedColumnIndex != columnIndex) { + if (columnIndex >= grid.getFrozenColumnCount()) { + // Scroll to new focused column. + grid.getEscalator().scrollToColumn(columnIndex, + ScrollDestination.ANY, 0); + } + focusedColumnIndex = columnIndex; } -- cgit v1.2.3