summaryrefslogtreecommitdiffstats
path: root/client
diff options
context:
space:
mode:
authorJohn Ahlroos <john@vaadin.com>2013-10-01 16:55:39 +0300
committerVaadin Code Review <review@vaadin.com>2013-10-09 11:30:08 +0000
commit3e593b0949b2b26fdc89b2aa5e8e93b006a513d0 (patch)
treef22450f49df60f16e3cfccfa00fb56b30da94be3 /client
parent63f10ec8bbeb6faa5ff685bfe375b1d0decd39cd (diff)
downloadvaadin-framework-3e593b0949b2b26fdc89b2aa5e8e93b006a513d0.tar.gz
vaadin-framework-3e593b0949b2b26fdc89b2aa5e8e93b006a513d0.zip
Focus selected row in Table #12540
Change-Id: Ic920f9cb11840a456a7c49746317eaccde1e1406
Diffstat (limited to 'client')
-rw-r--r--client/src/com/vaadin/client/ui/VScrollTable.java11
1 files changed, 11 insertions, 0 deletions
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