Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hovered background in List widget isn't reset when scrolling reuses an existing list item #3584

Closed
2 tasks done
dweymouth opened this issue Jan 19, 2023 · 1 comment
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@dweymouth
Copy link
Contributor

dweymouth commented Jan 19, 2023

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

If scrolling a list widget with a lot of data and a row was hovered when scrolling began, every several rows will incorrectly have the hover background set when it reuses the listItem for the row that was originally hovered.

How to reproduce

Run the example code, resize the window so a small handful of list rows are visible, hover over one, and start scrolling. Continue scrolling and note that some rows have the hover background set as they scroll by.

Screenshots

No response

Example code

package main

import (
	"strconv"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	myApp := app.New()
	myWindow := myApp.NewWindow("List scrolling bug")

	l := widget.NewList(
		func() int { return 100 },
		func() fyne.CanvasObject {
			return widget.NewLabel("")
		},
		func(id widget.ListItemID, lbl fyne.CanvasObject) {
			lbl.(*widget.Label).SetText(strconv.Itoa(id))
		})
	myWindow.SetContent(l)
	myWindow.ShowAndRun()

}```

### Fyne version

2.3.0

### Go compiler version

go1.19.4 darwin/amd64

### Operating system

macOS

### Operating system version

Big Sur 11.4

### Additional Information

_No response_
@dweymouth dweymouth added the unverified A bug that has been reported but not verified label Jan 19, 2023
@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Jan 20, 2023
@andydotxyz andydotxyz added this to the Fixes (v2.3.x) milestone Jan 20, 2023
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jan 20, 2023
@andydotxyz
Copy link
Member

Fixed on develop

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants