List changed event was not fired when SetCurrentItem() was called. Fixes #315
This commit is contained in:
parent
0e689965bb
commit
f63eca142c
7
list.go
7
list.go
|
@ -95,13 +95,14 @@ func (l *List) SetCurrentItem(index int) *List {
|
|||
if index < 0 {
|
||||
index = 0
|
||||
}
|
||||
l.currentItem = index
|
||||
|
||||
if index != l.currentItem && l.changed != nil {
|
||||
item := l.items[l.currentItem]
|
||||
l.changed(l.currentItem, item.MainText, item.SecondaryText, item.Shortcut)
|
||||
item := l.items[index]
|
||||
l.changed(index, item.MainText, item.SecondaryText, item.Shortcut)
|
||||
}
|
||||
|
||||
l.currentItem = index
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue