fyne icon indicating copy to clipboard operation
fyne copied to clipboard

[Mobile,Linux] Scrolling, by dragging, in widget.List list not working correctly

Open emdete opened this issue 2 years ago • 10 comments

Checklist

  • [X] I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • [X] This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

if i enable -tags mobile the lists behave strange: while no item is selected, dragging works as extected.

after an item is selected the touch moves the selected item under the touch point. after that you cannot select a different item.

you can't even dragg more than a page because the currently selected item jumps under your finger giving you the same starting point always.

on a desktop computer (with mouse) it works as expected.

How to reproduce

compile a program with a list with -tags mobile

Screenshots

a video would be better here - if that would help let me know :)

Example code

package main

import (                 
        "fyne.io/fyne/v2"    
        "fyne.io/fyne/v2/app"      
        "fyne.io/fyne/v2/container"
        "fyne.io/fyne/v2/widget"
)

var data = []string{          
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
        "a", "string", "list",
}

func main() {             
        myApp := app.New()                       
        myWindow := myApp.NewWindow("Box Layout")
        myWindow.SetContent(container.NewBorder(
                nil, nil, nil, nil,
                widget.NewList(     
                        func() int {            
                                return len(data)
                        },
                        func() fyne.CanvasObject {
                                return widget.NewLabel("template")
                        },
                        func(i widget.ListItemID, o fyne.CanvasObject) {
                                o.(*widget.Label).SetText(data[i])
                        }),
                ))
        myWindow.ShowAndRun()
}

Fyne version

v2.3.0

Go compiler version

10.2.1

Operating system

Linux

Operating system version

buster/sid

Additional Information

this is on a Librem5

emdete avatar Dec 30 '22 13:12 emdete