Skip to content

[v3] Cannot unhide a menu item if it starts hidden #4088

@IanVS

Description

@IanVS

Description

After the fix for #4077, it's not possible to to unhide (show) a menu item that starts off as hidden.

To Reproduce

In the menu example, add this:

	// Hidden menu item
	hidden := myMenu.Add("Hidden").SetHidden(true)

	// Unhide callback
	myMenu.Add("Toggle hidden").OnClick(func(ctx *application.Context) {
		hidden.SetHidden(!hidden.Hidden())
	})

Then start the example, and click the Toggle hidden menu item. The "Hidden" menu item is not shown (bug).

If you remove the .SetHidden(true) from hidden, then toggling works correctly, both hiding and unhiding.

Expected behaviour

I should be able to unhide a menu item that starts off hidden.

Screenshots

No response

Attempted Fixes

No response

System Details

# System

┌──────────────────────────────────────────────────┐
| Name          | MacOS                            |
| Version       | 15.2                             |
| ID            | 24C101                           |
| Branding      | Sequoia                          |
| Platform      | darwin                           |
| Architecture  | arm64                            |
| Apple Silicon | true                             |
| CPU           | Apple M2 Max                     |
| CPU 1         | Apple M2 Max                     |
| CPU 2         | Apple M2 Max                     |
| GPU           | 30 cores, Metal Support: Metal 3 |
| Memory        | 64 GB                            |
└──────────────────────────────────────────────────┘

# Build Environment

┌─────────────────────────────────────────────────────────┐
| Wails CLI    | v3.0.0-dev                               |
| Go Version   | go1.24.0                                 |
| Revision     | 5059adc561a9613f943bb9bb1e17d55c83717631 |
| Modified     | false                                    |
| -buildmode   | exe                                      |
| -compiler    | gc                                       |
| CGO_CFLAGS   |                                          |
| CGO_CPPFLAGS |                                          |
| CGO_CXXFLAGS |                                          |
| CGO_ENABLED  | 1                                        |
| CGO_LDFLAGS  |                                          |
| GOARCH       | arm64                                    |
| GOARM64      | v8.0                                     |
| GOOS         | darwin                                   |
| vcs          | git                                      |
| vcs.modified | false                                    |
| vcs.revision | 5059adc561a9613f943bb9bb1e17d55c83717631 |
| vcs.time     | 2025-02-16T05:02:25Z                     |
└─────────────────────────────────────────────────────────┘

# Dependencies

┌───────────────────────────┐
| Xcode cli tools | 2409    |
| npm             | 10.9.2  |
| *NSIS           | v3.10   |
|                           |
└─ * - Optional Dependency ─┘

# Checking for issues

 SUCCESS  No issues found

# Diagnosis

 SUCCESS  Your system is ready for Wails development!

Additional context

Discord thread: https://discord.com/channels/1042734330029547630/1334926670070677555/1334926670070677555

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions