as per RT-19227 ComboBox is intended to support duplicate items: selecting one of the duplicates updates the selected index to the actual position (was: to first occurence). This actual position doesn't always seem to be sync'ed to to listView's selection.
To reproduce the behaviour:
- run the example inRT-19227
- follow the steps to fill the list with duplicates
- click in dropdown to select some index > 0, f.i. 1
- open the dropdown again
- expected: item at 1 is selected
- actual: item at 0 is selected
Note that selecting via keyboard (f.i. down) in the open dropdown behaves as expected.
To see the unsync'ed list selectionIndex, add the following lines:
testedComboBox.setOnShown(e -> {
System.out.println("shown selectedIndex " + testedComboBox.getSelectionModel().getSelectedIndex());
ComboBoxListViewSkin skin = (ComboBoxListViewSkin) testedComboBox.getSkin();
ListView list = skin.getListView();
System.out.println("list selected " + list.getSelectionModel().getSelectedIndex());
});
Suggesting a priority of minor: after all, duplicates are borderline pathological
To reproduce the behaviour:
- run the example in
- follow the steps to fill the list with duplicates
- click in dropdown to select some index > 0, f.i. 1
- open the dropdown again
- expected: item at 1 is selected
- actual: item at 0 is selected
Note that selecting via keyboard (f.i. down) in the open dropdown behaves as expected.
To see the unsync'ed list selectionIndex, add the following lines:
testedComboBox.setOnShown(e -> {
System.out.println("shown selectedIndex " + testedComboBox.getSelectionModel().getSelectedIndex());
ComboBoxListViewSkin skin = (ComboBoxListViewSkin) testedComboBox.getSkin();
ListView list = skin.getListView();
System.out.println("list selected " + list.getSelectionModel().getSelectedIndex());
});
Suggesting a priority of minor: after all, duplicates are borderline pathological