-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
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.