-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
I am using a SelectGrid
with a TableSelectionModel
using the selection mode TableSelectionMode.SHIFT
.
When selecting a previously unselected row without holding the Ctrl key, the underlying CtrlClickSelectionHandler
calls SelectionModel<JsonObject>.deselectAll()
. This triggers an event with an empty selection, almost immediately following by an event with the newly selected row.
Example:
SelectGrid<T> grid2 = new SelectGrid<>();
TableSelectionModel<T> tableSelectionModel = new TableSelectionModel<>();
tableSelectionModel.setMode(TableSelectionMode.SHIFT);
grid2.setSelectionModel(tableSelectionModel);
grid2.addSelectionListener(event -> {
LOGGER.debug(String.format("%d entries in selection",
event.getAllSelectedItems().size()));
});
When selecting a row as described above, the logger returns the following:
[DEBUG] 0 entries in selection
[DEBUG] 1 entries in selection
I would have expected only one event containing the new selection instead of two, one of which contains an empty selection. Is it possible to allow for this behaviour?
Metadata
Metadata
Assignees
Labels
No labels