How to use List -> FocusLost() #3580
Answered
by
Jacalz
junmaqiang
asked this question in
Q&A
-
I don't want the rows of the List to be selected, I'm using widget.NewListWithData()I don't know how to use this methodI looked at the test code, but I can't use it yet, fyne V2.3.0 is no test case for widget.NewListWithData() |
Beta Was this translation helpful? Give feedback.
Answered by
Jacalz
Jan 18, 2023
Replies: 1 comment
-
You should not call the What you want to do is to make the list's |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Jacalz
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You should not call the
FocusLost()
method as that is what the focus manager calls to tell the widget that it has lost focus.What you want to do is to make the list's
.OnSelected(id ListItemID)
function (https://pkg.go.dev/fyne.io/fyne/v2/widget#List) call.Unselect(id)
(https://pkg.go.dev/fyne.io/fyne/v2/widget#List.Unselect) on the list.