Skip to content

SystemContextMenu support outside of editable text? #171732

@justinmc

Description

@justinmc

Use case

Currently, SystemContextMenu is only supported in the context of a text input field. It doesn't even work when readOnly is true, due to the lack of an active TextInputConnection (see #171242). So when users select text in a read only field, or in a SelectionArea, they currently see the Flutter-rendered menu, which is not quite identical to the SystemContextMenu.

Proposal

Flutter should support showing the SystemContextMenu for non-editable text and even other cases, like long-pressing an image to show a context menu.

Under the hood, the context menu is inserted into the UITextInputView (explained in #171242 (comment)), so it would be necessary to refactor this to support insertion into something like the FlutterView.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectteam-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