Skip to content

Show ContextMenu on long press on visual element in mobile platformΒ #33402

Open

Description

@bohdan-bats-bs

Description

We can now attach a context menu to any visual element using a MenuFlyout control, but on mobile it doesn't work correctly. It should appear on long press on visual element.

Public API Changes

API is not changed.

Intended Use-Case

It is very important issue, because context menu is used very often and developers wait that it will work on mobile on long press. This functionality will help .NET MAUI become #1 platform.

Activity

  1. changed the title [-]Add ContextMenu property to common visual elements[/-] [+]Show ContextMenu on long press on visual element in mobile platform[/+] on Jan 6, 2026
  2. added this to the Backlog milestone on Jan 7, 2026
  3. jfversluis commented on Jan 7, 2026

    @jfversluis
    Member

    Thanks for your suggestion! Honestly, personally I think this is just not a super common pattern in mobile and that's why it probably wasn't added as such.

    I don't think we will be adding this anytime soon, instead, I would be interested to maybe add #12816 and #8675 so that you should be able to implement this on your own where needed.

    I've added this to the backlog for now and lets see if more people will find this and leave their comments or emoji reactions.

  4. bohdan-bats-bs commented on Jan 7, 2026

    @bohdan-bats-bs
    Author

    This suggestion is also here.

  5. bohdan-bats-bs commented on Jan 7, 2026

    @bohdan-bats-bs
    Author

    I also don't understand how FlyoutBase.ContextFlyout works on mobile for now. When does it appear?

  6. haavamoa commented on Jan 8, 2026

    @haavamoa

    If you simply want a context menu attached to any visual element with long press, natively, you can use our library:

    https://github.com/DIPSAS/DIPS.Mobile.UI/wiki/Context-Menus

    I agree its not super common, but we have added this to our entire application to add some nice sugar to it. Hoping that our users will in the furure find it useful because we can group functionality closer to the context (like cards). Its actually also made us do some rethinking with our designers to figure out what we mean by our features, as they suddenly have to come up with a word for a feature (due to context menus have to be words with icons) that maybe just was a icon before.

    Heres an example from our app:
    image

  7. funnelshift commented on Sep 7, 2026

    @funnelshift

    @jfversluis It's pretty common to press and hold on a listitem or an item in general to display a context menu, just like a right click.
    I've seen that .NET 11 is getting the long press functionality.
    Since ListView is Obsolete and CollectionView still doesn't has a proper way to display a contextmenu across different systems (SwipeView isn't a proper contextmenu). This could give the opportunity to bring this feature back.

    Not only that but WinUI, macOS, iOS and Android already has a proper ContextMenu across systems:
    Android
    "To reveal a contextual menu, tap and hold, or right click (desktop), selected text."
    Android - Contextual Action Bar
    iOS - mac Catalyst
    WinUI

  8. funnelshift commented on Sep 7, 2026

    @funnelshift
  9. Eilon commented on Sep 7, 2026

    @Eilon
  10. pinned and unpinned a comment on Sep 8, 2026
  11. jfversluis commented on Sep 8, 2026

    @jfversluis
    Member

    Added it for .NET 12 to maybe revisit for that!

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

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions