Skip to content

Commit

Permalink
[SuperEditor][DemoApp] Fix content being deleted on iOS textfield demo (
Browse files Browse the repository at this point in the history
Resolves #2006) (#2008)
  • Loading branch information
angelosilvestre authored and web-flow committed May 16, 2024
1 parent d957a48 commit 3676120
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class _MobileSuperTextFieldDemoState extends State<MobileSuperTextFieldDemo> {
late ImeAttributedTextEditingController _textController;

_TextFieldSizeMode _sizeMode = _TextFieldSizeMode.short;
late MobileTextFieldDemoConfig _demoConfig;

bool _showDebugPaint = false;

Expand All @@ -47,6 +48,8 @@ class _MobileSuperTextFieldDemoState extends State<MobileSuperTextFieldDemo> {
text: widget.initialText.copyText(0),
),
);

_demoConfig = _createDemoConfig();
}

@override
Expand Down Expand Up @@ -110,7 +113,7 @@ class _MobileSuperTextFieldDemoState extends State<MobileSuperTextFieldDemo> {
child: TapRegion(
groupId: widget.textFieldTapRegionGroupId,
onTapOutside: (_) => widget.textFieldFocusNode.unfocus(),
child: widget.createTextField(_createDemoConfig()),
child: widget.createTextField(_demoConfig),
),
),
),
Expand Down Expand Up @@ -162,6 +165,8 @@ class _MobileSuperTextFieldDemoState extends State<MobileSuperTextFieldDemo> {
} else if (newIndex == 3) {
_sizeMode = _TextFieldSizeMode.empty;
}

_demoConfig = _createDemoConfig();
});
},
),
Expand Down

0 comments on commit 3676120

Please sign in to comment.