]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fix Grid internal focus tracking with Editor open (#18956)
authorTeemu Suo-Anttila <teemusa@vaadin.com>
Mon, 21 Sep 2015 08:10:43 +0000 (11:10 +0300)
committerPatrik Lindström <patrik@vaadin.com>
Mon, 21 Sep 2015 08:56:48 +0000 (08:56 +0000)
Change-Id: I92b9f632960c041111ae9aada6055eab14a9bd81

client/src/com/vaadin/client/widgets/Grid.java

index 5dc85834237738d32d6cd450a980e7164e43cd68..6457200dd2f46c6a92002630c8b7c9f6e7baec81 100644 (file)
@@ -1360,6 +1360,11 @@ public class Grid<T> 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<T> 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;
                 }