Skip to content

Submenus not working on mobile #5398

Closed
Closed
@pneumaticdeath

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 I have menuItmes with child menus they can't be accessed when in a mobile layout

How to reproduce

  1. Run code below with --tags miobile
  2. Select menu Main
  3. Select menu Foo
  4. Unable to select Bar or Baz menu

Screenshots

Screenshot 2025-01-11 at 13 54 50

Example code

package main

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

func main() {
	a := app.New()
	w := a.NewWindow("Multi layered menus")

	entry := widget.NewEntry()

	barMI := fyne.NewMenuItem("Bar", func() { entry.Text = "Bar"; entry.Refresh() })
	bazMI := fyne.NewMenuItem("Baz", func() { entry.Text = "Baz"; entry.Refresh() })
	barbazMenu := fyne.NewMenu("Foo", barMI, bazMI)
	fooMI := fyne.NewMenuItem("Foo", func() {})
	fooMI.ChildMenu = barbazMenu
	fooMenu := fyne.NewMenu("Main", fooMI)
	mainMenu := fyne.NewMainMenu(fooMenu)

	w.SetMainMenu(mainMenu)
	w.SetContent(entry)

	w.ShowAndRun()
}

Fyne version

v2.5.3

Go compiler version

1.23.4

Operating system and version

macOS Sonoma 14.6.1

Additional Information

works fine in desktop mode

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    blockerItems that would block a forthcoming releasebugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions