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

mobile web paints the canvas too high up in chrome android #5410

Open
2 tasks done
hkparker opened this issue Jan 14, 2025 · 1 comment
Open
2 tasks done

mobile web paints the canvas too high up in chrome android #5410

hkparker opened this issue Jan 14, 2025 · 1 comment
Labels
unverified A bug that has been reported but not verified

Comments

@hkparker
Copy link
Contributor

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

I'm not actually sure if this is one bug or two, so apologies if I'm wrong on that, but top part of a border layout has multiple issues on mobile web as far as I can tell. So far I've noticed:

  1. a label doesn't appear
  2. buttons aren't clickable

Let me know if I should split these out into two tickets!

How to reproduce

fyne serve

view on desktop web, notice you can see "Header" and click on the buttons to change to content

view on mobile web, notice that you cannot see "Header" nor click any buttons

Screenshots

Screenshot from 2025-01-14 11-57-49

Screenshot_20250114-115902

Example code

package main

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

func main() {
	myApp := app.New()
	window := myApp.NewWindow("Title")
	window.Resize(fyne.NewSize(1024, 1024))

	title := widget.NewLabel("Header")
	title.Alignment = fyne.TextAlignCenter

	welcomeContent := container.NewStack(widget.NewLabel("welcome page"))
	secondContent := container.NewStack(widget.NewLabel("second page"))
	secondContent.Hide()

	var welcomeButton *widget.Button
	var secondButton *widget.Button
	welcomeButton = widget.NewButton("Welcome", func() {
		secondContent.Hide()
		welcomeContent.Show()

		secondButton.Importance = widget.LowImportance
		secondButton.Refresh()
		welcomeButton.Importance = widget.MediumImportance
		welcomeButton.Refresh()
	})
	secondButton = widget.NewButton("Second Page", func() {
		welcomeContent.Hide()
		secondContent.Show()

		welcomeButton.Importance = widget.LowImportance
		welcomeButton.Refresh()
		secondButton.Importance = widget.MediumImportance
		secondButton.Refresh()
	})
	secondButton.Importance = widget.LowImportance

	buttons := container.NewCenter(container.NewHBox(
		welcomeButton,
		secondButton,
	))

	header := container.NewVBox(
		title,
		buttons,
	)

	main := container.NewVScroll(container.NewStack(
		welcomeContent,
		secondContent,
	))

	window.SetContent(container.New(
		layout.NewBorderLayout(header, nil, nil, nil),
		header,
		main,
	))

	window.Show()
	myApp.Run()
}

Fyne version

2.5.3

Go compiler version

go1.23.4 linux/amd64

Operating system and version

Arch Linux / Android 15 / Chrome

Additional Information

No response

@hkparker hkparker added the unverified A bug that has been reported but not verified label Jan 14, 2025
@hkparker
Copy link
Contributor Author

Following up here after a call with @andydotxyz:

It looks like this isn't related to any specific container/layout issue in Fyne, the problem is likely that the whole canvas is just shifted up a bit due to an issue with Fyne in my environment (android chrome). A few interesting points:

  1. The buttons do actually work if I click below them by the amount that is missing from the top. So the map of what area should be clickable seems to be tracking correctly, but things are painted too high up
  2. Testing on the latest commit of develop right now (0d08945) doesn't result in any change

Probably worth renaming this, but I'm not sure to what. Maybe something like "mobile web paints the canvas too high up in chrome android", or something to that effect.

@hkparker hkparker changed the title Issues with BorderLayout on mobile web mobile web paints the canvas too high up in chrome android Jan 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

1 participant