Skip to content

☂️ Proposal: desktop context menu fidelity #74255

@justinmc

Description

@justinmc

The desktop text selection toolbars, as introduced in #73882 and #74286, have major limitations that make them not as good as native. We should either find a way to use the native context menus, or we should work to fix each of these problems.

  • We can't draw the menu outside of the current window. Also, the menu can't receive mouse events (like hover) unless the current menu is focused.
  • The only buttons available are the default mobile buttons (cut/copy/paste/select all). We should support all of the same buttons that display natively.
  • It should be possible for Flutter devs to customize the menu.
  • The native Mac menu has a flashing animation when clicked.
  • Submenus should be possible and easy to implement.
  • Currently, only EditableText widgets can show the menu. Right-clicking elsewhere doesn't show it. Fixing this probably requires refactoring TextSelectionControls to work with both the existing setup and menus (like showMenu).
  • Menu items that are wider than the default width are ellided, but on native the menu grows to accommodate them.
  • On Windows and Linux we use a Material-style menu, but we might want to build a menu that looks like the native one instead.
  • The native Mac context menu is slightly transparent and has a blur effect (screenshots below).

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projecta: desktopRunning on desktopa: fidelityMatching the OEM platforms betterc: proposalA detailed proposal for a change to Flutterframeworkflutter/packages/flutter repository. See also f: labels.platform-linuxBuilding on or for Linux specificallyplatform-macBuilding on or for macOS specificallyplatform-windowsBuilding on or for Windows specificallyteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions