Skip to content

Commit

Permalink
add OnFocus event to list
Browse files Browse the repository at this point in the history
  • Loading branch information
csturiale committed Dec 17, 2024
1 parent 8050e24 commit 666ff11
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ type List struct {
UpdateItem func(id ListItemID, item fyne.CanvasObject) `json:"-"`
OnSelected func(id ListItemID) `json:"-"`
OnUnselected func(id ListItemID) `json:"-"`
OnScroll func(id ListItemID) `json:"-"`
OnFocus func(id ListItemID) `json:"-"`

// HideSeparators hides the separators between list rows
//
Expand Down Expand Up @@ -188,7 +188,7 @@ func (l *List) scrollTo(id ListItemID) {
}
l.offsetUpdated(l.scroller.Offset)
defer func() {
if f := l.OnScroll; f != nil {
if f := l.OnFocus; f != nil {
f(id)
}
}()
Expand Down

0 comments on commit 666ff11

Please sign in to comment.