Skip to content

Commit 4e547a6

Browse files
authored
fix: Context menu on TextFormBox (#1219)
2 parents 16265a0 + 5132fab commit 4e547a6

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## [next]
2+
3+
- fix: Context Menu was not available on TextFormBox ([#1216](https://github.com/bdlukaa/fluent_ui/pull/1216), [#1219](https://github.com/bdlukaa/fluent_ui/pull/1219))
4+
15
## 4.11.4
26

37
- feat: Added Tagalog localization support ([#1207](https://github.com/bdlukaa/fluent_ui/pull/1207))

lib/src/controls/form/text_box.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class TextBox extends StatefulWidget {
198198
this.stylusHandwritingEnabled =
199199
EditableText.defaultStylusHandwritingEnabled,
200200
this.enableIMEPersonalizedLearning = true,
201-
this.contextMenuBuilder = _defaultContextMenuBuilder,
201+
this.contextMenuBuilder = defaultContextMenuBuilder,
202202
this.spellCheckConfiguration,
203203
this.magnifierConfiguration,
204204
}) : assert(obscuringCharacter.length == 1),
@@ -560,7 +560,7 @@ class TextBox extends StatefulWidget {
560560
/// * [AdaptiveTextSelectionToolbar], which is built by default.
561561
final EditableTextContextMenuBuilder? contextMenuBuilder;
562562

563-
static Widget _defaultContextMenuBuilder(
563+
static Widget defaultContextMenuBuilder(
564564
BuildContext context, EditableTextState editableTextState) {
565565
final undoController = editableTextState.widget.undoController;
566566
return FluentTextSelectionToolbar(

lib/src/controls/form/text_form_box.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ class TextFormBox extends ControllableFormBox {
129129
Color? highlightColor,
130130
Color? errorHighlightColor,
131131
Color? unfocusedColor,
132-
EditableTextContextMenuBuilder? contextMenuBuilder,
132+
EditableTextContextMenuBuilder? contextMenuBuilder =
133+
TextBox.defaultContextMenuBuilder,
133134
TextMagnifierConfiguration? magnifierConfiguration,
134135
SpellCheckConfiguration? spellCheckConfiguration,
135136
}) : assert(initialValue == null || controller == null),

0 commit comments

Comments
 (0)