Merge pull request #376 from and3md/combobox_items_fix

Fix ComboBox setting items #375
This commit is contained in:
Vadim Lopatin 2017-06-21 09:58:02 +03:00 committed by GitHub
commit 0cbf746cbc
1 changed files with 1 additions and 1 deletions

View File

@ -68,7 +68,7 @@ class ComboBoxBase : HorizontalLayout, OnClickHandler {
@property ComboBoxBase selectedItemIndex(int index) {
if (_selectedItemIndex == index)
return this;
if (_selectedItemIndex != -1) {
if (_selectedItemIndex != -1 && _adapter.itemCount > _selectedItemIndex) {
_adapter.resetItemState(_selectedItemIndex, State.Selected | State.Focused | State.Hovered);
}
_selectedItemIndex = index;