Menubar breaks cross platform menubar behavior conventions

Open
#1,372 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
1-2 days
Newbie friendliness
22/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
csharp
Domain
desktop

Research direction

The issue names no files or tests. Start by running the WinUI 3 Gallery app and reproducing the press-hold-drag-release on a menu bar or flyout, then find the menu bar sample in the gallery's C# and XAML code. The cause may sit in the WinUI framework rather than the gallery, which the issue does not identify. Done means a press, drag and release over a menu item activates it, and the maintainers have agreed where the fix belongs.

Written by the indexing model from the issue text.

Description

bug
Which version of the app?

WinUI 3 Gallery

Description

Across different platforms you can operate menubars and dropdowns using a "drag-click" that is initiated by pressing down the primary mouse key over the button, keeping the primary mouse key pressed while going through the menus and releasing over the currently hovered/drag-clicked/selected action to activate it.[^1]

To boil it down, the steps below doesn't work anymore. This used to work with win32 top level menu items, but the behavior has regressed.

Steps to Reproduce

  1. Press down on your mouse on a top level menu item (File, Edit, View, Help)
  2. Keep holding down the mouse button
  3. The top level menu opens
  4. You move the cursor over the menu item you want to activate
  5. You release the mouse button

Examples of dropdowns and menubars supporting drag clicking:
Win32 menubars: http://sx.permik.xyz/macup/2023-10-07/04-26-55.mp4 (For some reason the Power Toys Mouse Highlighter gets hidden by the dialogs at ~27 secs)
macOS top level menubar
Android appbar actions, try to swipe downwards on the three vertical dots located on an app bar and keep your finger pressed, release to finish the action.
Web browsers using the <select> element (Safari, Firefox, regressed in Chromium since ???)

Yes, this regression also applies to the ComboBox element also, but I'll wait for feedback on this before making an another issue about that.

[^1]: Aside: This behavior works across OS's and is a delightful behavior that feels really good when it's implemented. Something about not needing to click a second time to act on a dropdown that I personally find really satisfying. This also gives the powerusers the ability to "flick" really fast through visual menus because of reducing the need to stop to click something.

Screenshots

No response

Windows version

Insider Build (xxxxx)

Additional context

Version 23H2 OS Build (25967.1000)
WinUI3 Gallery Version: 2.2.0.0

Dominant language
C#
Stars
3.7k
Forks
766
Avg merge
3d 10h
Merged PRs (30d)
7

Getting set up

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.

More from microsoft/WinUI-Gallery

All issues in microsoft/WinUI-Gallery

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.