Fixed double item selection on combo list when changing selected item from code.

This commit is contained in:
and3md 2017-03-21 18:12:42 +01:00
parent 23ff14f8e8
commit 767aa4bdbe
1 changed files with 3 additions and 0 deletions

View File

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