HandyOrg / HandyOrg/HandyControl

ContextMenuToggleButton sometimes need two clicks to open the menu

Open
#1,418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
7.2k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

If you click on a blank position or MenuItem, you need to click twice on the ContextMenuToggleButton to open the menu next time.

动画2

Steps to reproduce the bug
<StatusBarItem>
    <hc:ContextMenuToggleButton Content="Click Me">
        <hc:ContextMenuToggleButton.Menu>
            <ContextMenu>
                <MenuItem Header="test" />
            </ContextMenu>
        </hc:ContextMenuToggleButton.Menu>
    </hc:ContextMenuToggleButton>
</StatusBarItem>
Expected behavior

The ContextMenuToggleButton toggles the opening menu correctly in all cases.

Screenshots

No response

NuGet package version

HandyControl 3.4.0

IDE

Visual Studio 2022

Framework type

.Net 6.0

Windows version

Windows 11 (22000)

Additional context

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the ContextMenuToggleButton implementation and reproducing the issue with the provided XAML in a .NET 6 WPF application. Check the behavior after clicking a blank position or MenuItem, then verify that the menu opens on the first subsequent click in each case.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.