From 3e593b0949b2b26fdc89b2aa5e8e93b006a513d0 Mon Sep 17 00:00:00 2001 From: John Ahlroos Date: Tue, 1 Oct 2013 16:55:39 +0300 Subject: Focus selected row in Table #12540 Change-Id: Ic920f9cb11840a456a7c49746317eaccde1e1406 --- client/src/com/vaadin/client/ui/VScrollTable.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'client') diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 9cec59a5a2..104cbbd5b9 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1072,6 +1072,17 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (selected != row.isSelected()) { row.toggleSelection(); + + if (selected) { + if (focusedRow == null + || !selectedRowKeys.contains(focusedRow + .getKey())) { + // The focus is no longer on a selected row, + // move focus to first selected row + setRowFocus(row); + } + } + if (!isSingleSelectMode() && !selected) { // Update selection range in case a row is // unselected from the middle of a range - #8076 -- cgit v1.2.3