Skip to content

MenuBar: Left/Right with a flyout open opens the next item's flyout, which closes immediately #26654

Open

Description

@MartinZikmund

Current behavior 🐛

With a MenuBarItem's flyout open, pressing Right (or Left) moves focus to the next enabled MenuBarItem and opens its flyout, which then closes immediately. The keyboard can't walk across the menu bar with menus open.

The cause is in FlyoutBase.RemoveFromOpenFlyouts. When the first flyout closes, it removes itself from _openFlyouts and defers Closed to a dispatcher callback. That callback then hides _openFlyouts[0]. MenuBarItem.OpenFlyoutFrom closes the current flyout and opens the next one synchronously, so by the time the callback runs, _openFlyouts[0] is the newly opened flyout, and the callback hides it.

Expected behavior 🎯

As on WinUI: the next item's flyout opens and stays open, so Left/Right walks across the menu bar with the menus open.

How to reproduce it (as minimally and precisely as possible) 🔬

  1. Create a MenuBar with two MenuBarItems, each with one MenuFlyoutItem.
  2. Open the first item's flyout (click it, or invoke its automation peer).
  3. Press Right.

Focus moves to the second item, but its flyout closes right after it opens.

The runtime test Given_MenuBar.When_Flyout_Open_And_Right_Arrow_Then_Next_Flyout_Opens (#26612) reproduces it: IsFlyoutOpen() on the second item is false after the key press.

Workaround 🛠️

None. Clicking the next item opens its flyout normally.

Affected platforms 📱💻🖥️

Skia (all targets)

Uno.Sdk version (and other relevant versions) 📦

master as of 2026-11-23

IDE version 🧑‍💻

Not IDE related.

Anything else we need to know? 💬

Related: #2895 (Closed should be raised on presenter unload, which the deferred callback's TODO Uno points to), #26399 (re-showing the same flyout at a new target), #26400 (opening an unrelated flyout doesn't close the open one). The keyboard handling itself is not the cause: while the flyout is open, Right reaches only the presenter's KeyDown handler, not the MenuBarItem's.

Activity

  1. added
    kind/bug
    triage/untriaged
    area/popups 💬
    on Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/popups 💬kind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions