Skip to content

Flutter should expose text editing shortcut logic for reuse #97830

Open

Description

@justinmc

Flutter has a ton of logic for handling keyboard shortcuts in the framework, mapping them in default_text_editing_shortcuts.dart and actually handling them privately in editable_text.dart. We should make this logic reusable by developers writing their own text editors.

Why?

Previously, this logic was exposed in a class called TextEditingActionTarget, but that was removed in #90684. It was brought up in the comments after merge that this change had broken two major text editing projects.

Besides being impractical for developers to reimplement all of this logic on their own, doing so would quickly get out of sync with Flutter's behavior and cause strange discrepancies in text editing behavior between simple TextFields and the custom text editors.

How?

The shortcuts and their behavior is already overridable by using Shortcuts and Actions widgets, but the problem is applying them to something other than an EditableText. This was possible by mixing in TextEditingActionTarget, but it was brought up in the comments that a composable solution may be preferred instead.

We should flesh out this idea and then expose it publicly.

Activity

  1. added
    in triagePresently being triaged by the triage team
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    c: contributor-productivityTeam-specific productivity, code health, technical debt.
    c: proposalA detailed proposal for a change to Flutter
    and removed
    in triagePresently being triaged by the triage team
    on Feb 7, 2022
  2. added
    P3Issues that are less important to the Flutter project
    on Aug 4, 2025
  3. orestesgaolin commented on Aug 30, 2025

    @orestesgaolin
    Contributor

    I was wondering if there was ever any progress made in this area? Perhaps someone on the team started drafting a design document or prototypes of how text editing shortcuts could be reused.

    I stumbled upon this issue while researching similar issues to mine #174758.

  4. justinmc commented on Aug 31, 2025

    @justinmc
    ContributorAuthor

    I don't think any progress has been made, but I am still a big advocate for doing this.

    Are you thinking that a solution to this issue would solve your problem in #174758? You want to remove all the shortcuts and then reapply them yourself or something like that?

  5. orestesgaolin commented on Aug 31, 2025

    @orestesgaolin
    Contributor

    Ideally I wouldn't like to reapply them but it seems that without changing the order of operations (shortcuts->text input) it may not be possible.
    Maybe text input intents could inherit from some class that could be then ignored and stopped from propagation in surrounding Shortcuts?

  6. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 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

    P3Issues that are less important to the Flutter projectc: contributor-productivityTeam-specific productivity, code health, technical debt.c: proposalA detailed proposal for a change to Flutterp: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions