ListBox multi-selection, row toggling & modifiers key

Hi there,

The multiple rows & toggle selection behavior of Juce::ListBox is a bit confusing. I can’t really get what seems to be the expected behavior without providing my own component for each rows.

As one can see in ListBox::selectRowsBasedOnModifierKeys, right now you can:

  • Remove multiple selection, which is the default behavior

If you do that, you can only select one row, whatever the modifier is.

However, you can never de-select anything, whatever the modifier is, which is problematic IMO… you would want sometime to be able to only select one row at a time, but also none by clicking again on a selected row, with or without a modifier.

  • Have Multiple selection enable

In that case you can activate / or deactivate toggling a row when clicking on it.

However, you can never have multiple selection through modifiers if you activate toggle row selection.

So you can either have row toggling, or you can have multiple selection, but never both. It would be great if we could have row toggling not being related with the multiple selection.