-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Checklist
- I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
- This issue only relates to a single bug. I will open new issues for any other problems.
Describe the bug
When running the tree widget example from the Fyne documentation, selecting a tree node (e.g., a) and then selecting a different one (e.g., c) causes the new selection to appear correctly with the blue highlight. However, the first selected node (a) remains highlighted in a light grey color, as if it is still hovered.
How to reproduce
- Run the Fyne tree example code, also attached below
- Click on node
a- it gets selected with a blue highlight - Click on node
c- it becomes blue as expected, but nodearemains light grey (on hover color)
Screenshots
Example code
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
func main() {
myApp := app.New()
myWindow := myApp.NewWindow("Table Widget")
tree := widget.NewTree(
func(id widget.TreeNodeID) []widget.TreeNodeID {
switch id {
case "":
return []widget.TreeNodeID{"a", "b", "c"}
case "a":
return []widget.TreeNodeID{"a1", "a2"}
}
return []string{}
},
func(id widget.TreeNodeID) bool {
return id == "" || id == "a"
},
func(branch bool) fyne.CanvasObject {
if branch {
return widget.NewLabel("Branch template")
}
return widget.NewLabel("Leaf template")
},
func(id widget.TreeNodeID, branch bool, o fyne.CanvasObject) {
text := id
if branch {
text += " (branch)"
}
o.(*widget.Label).SetText(text)
})
myWindow.SetContent(tree)
myWindow.ShowAndRun()
}Fyne version
v2.6.1
Go compiler version
1.24.2
Operating system and version
Linux pop_os 24.04 amd64 Wayland, Windows 11 amd64
Additional Information
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
