-
Notifications
You must be signed in to change notification settings - Fork 90
Open
Description
Problem
CodeField does not expose a way to customize the text selection context menu
(copy / select all / custom actions), unlike Flutter's TextField and
EditableText, which provide contextMenuBuilder.
This makes it impossible to:
- Customize the selection toolbar
- Add app-specific actions (Search, Format, Go to line, etc.)
- Match platform behavior or design requirements
What works in TextField
TextField(
contextMenuBuilder: (context, editableTextState) {
return AdaptiveTextSelectionToolbar(
anchors: editableTextState.contextMenuAnchors,
children: const [
SelectionOptions(),
],
);
},
)Current CodeField API
CodeField(
controller: _codeController,
textStyle: const TextStyle(fontFamily: 'monospace'),
)There is currently no way to pass a contextMenuBuilder or otherwise customize
the selection toolbar.
Request / Proposal
Expose a contextMenuBuilder (or equivalent) on CodeField, and forward it
internally to the underlying EditableText.
Example API:
CodeField(
controller: _codeController,
contextMenuBuilder: (context, editableTextState) {
return AdaptiveTextSelectionToolbar(
anchors: editableTextState.contextMenuAnchors,
children: const [
SelectionOptions(),
],
);
},
)mineshp-mecha
Metadata
Metadata
Assignees
Labels
No labels