diff options
author | Artur <artur@vaadin.com> | 2017-01-13 11:54:01 +0200 |
---|---|---|
committer | Pekka Hyvönen <pekka@vaadin.com> | 2017-01-13 11:54:01 +0200 |
commit | a00429697b8340a56568465694cac6549954a51f (patch) | |
tree | 3edf15d1ade94ddd51bc325e1fd3f1e62a292836 /client | |
parent | 6897f6dcef2aa7b352529a3c34b86c69985ba788 (diff) | |
download | vaadin-framework-a00429697b8340a56568465694cac6549954a51f.tar.gz vaadin-framework-a00429697b8340a56568465694cac6549954a51f.zip |
Make it possible to deselect what was selected on the server (#8235)
* Make it possible to deselect what was selected on the server
Fixes #8221
Diffstat (limited to 'client')
-rw-r--r-- | client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java index ea0d6171af..55c1eddf61 100644 --- a/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java +++ b/client/src/main/java/com/vaadin/client/connectors/SingleSelectionModelConnector.java @@ -153,8 +153,14 @@ public class SingleSelectionModelConnector extends @Override public boolean deselect(JsonObject row) { - if (getRowHandle(row).equals(selectedRow)) { - select(null); + if (isSelected(row)) { + // If no selection has happened client side, then selectedRow is + // null but must be set so that a deselection event with the + // correct key can be sent to the server + selectedRow = getRowHandle(row); + selectedRow.pin(); + + return select(null); } return false; } |