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

Nested Draggable Objects Priority Issue #5090

Open
2 tasks done
BieHDC opened this issue Aug 24, 2024 · 0 comments
Open
2 tasks done

Nested Draggable Objects Priority Issue #5090

BieHDC opened this issue Aug 24, 2024 · 0 comments
Labels
Driver:mobile Issues relating to the mobile driver specifically

Comments

@BieHDC
Copy link
Contributor

BieHDC commented Aug 24, 2024

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 there are nested fyne.Draggable Objects there is an issue which one should get the Dragged event. Most of the time this is not noticeable, especially on desktop, and was exposed on a side project that adds swipe gestures for the mobile experience.
The simplest way to quickly encounter the issue is when you have a lot of sliders inside a scroll container (see example code).
On desktop this is not an issue because we have the mouse scroll wheel and the slider on the right to scroll.
However on mobile the scrolling is implemented through the Dragged event. The slider will always take priority and the only way to scroll is if you start to scroll on a non Draggable element (the widget.Label on the left in the example code) or empty space like padding.

How to reproduce

  1. Build Mobile App
  2. Run the App on the mobile device
  3. Try to scroll (see video)

Screenshots

1000001103.mp4

Example code

package main

import (
	"fmt"

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

func main() {
	app := app.New()
	window := app.NewWindow("Bugtest - Nested Dragged")
	window.SetPadded(false)
	window.Resize(fyne.NewSize(500, 600))
	window.CenterOnScreen()
	window.SetContent(container.NewVScroll(container.NewVBox(bunchOfSliders()...)))
	window.ShowAndRun()
}

func bunchOfSliders() []fyne.CanvasObject {
	var sliders []fyne.CanvasObject
	for i := range 20 {
		sliders = append(sliders,
			container.NewBorder(nil, nil,
				widget.NewLabel(fmt.Sprintf("%d", i)), // the label
				nil,
				widget.NewSlider(0, 100)))
	}
	return sliders
}

Fyne version

v2.5.1

Go compiler version

1.23.0

Operating system and version

Artix Linux amd64

Additional Information

No response

@BieHDC BieHDC added the unverified A bug that has been reported but not verified label Aug 24, 2024
@dweymouth dweymouth added Driver:mobile Issues relating to the mobile driver specifically and removed unverified A bug that has been reported but not verified labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Driver:mobile Issues relating to the mobile driver specifically
Projects
None yet
Development

No branches or pull requests

2 participants