Fix ComboBox setting items #375

This commit is contained in:
and3md 2017-06-20 20:50:57 +02:00
parent 6f4a9636a0
commit 8ec1c3cad1
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;