LIstView with SelectionMode.SIMPLE do not deselects items on click
Documentations says about selection modes:
SIMPLE - Multiple selections without having to use the control and shift keys
MULTI - Multiple selections
So, I suppose, SIMPLE mode works the same way as MULTI mode but without ctrl/shift keys.
I.e. we can select/deselect items just by clicking on them as in MULTI mode with ctrl.
But it does not work that way: a ListView with SIMPLE selection mode cannot deselect items on click.
It can only do that by clicking on white space below list items.
But what if my listview has no this white space. Then deselecting is impossible.
Is that designed behavior or it is a bug?
1. Tree works expected way, i.e. we can select/deselect items on click in SIMPLE mode.
2. Noticed, that listview in SIMPLE selection mode still works with ctrl and shift keys. but we cannot use ctrl-click to deselect item
Sorry to hear this isn't what you wanted, but I'd point out that this is the behavior from 2.x, so I'm not sure about calling it a bug.
Customizing this should be pretty straightforward. Start by subclassing ListViewSelectionModel (since you are working with a ListView - if you were on a Grid or a Tree, you'd need to pick the right selection model subclass accordingly). This has a method called handleMouseDown which works out what was clicked and how to respond to it (right click, ctrl/shift, etc). Overriding this method could allow you to check if the current index is selected (listView.findElementIndex(target)), and it so, de-select it (by calling select(index, false)).