File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
packages/flet/lib/src/controls Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -84,7 +84,8 @@ class _TextFieldControlState extends State<TextFieldControl>
8484 setState (() {
8585 _focused = _shiftEnterfocusNode.hasFocus;
8686 });
87- widget.backend.triggerControlEvent (widget.control.id, _shiftEnterfocusNode.hasFocus ? "focus" : "blur" );
87+ widget.backend.triggerControlEvent (
88+ widget.control.id, _shiftEnterfocusNode.hasFocus ? "focus" : "blur" );
8889 }
8990
9091 void _onFocusChange () {
@@ -122,7 +123,11 @@ class _TextFieldControlState extends State<TextFieldControl>
122123 String value = widget.control.attrs["value" ] ?? "" ;
123124 if (_value != value) {
124125 _value = value;
125- _controller.text = value;
126+ _controller.value = TextEditingValue (
127+ text: value,
128+ selection: TextSelection .collapsed (
129+ offset: value.length), // preserve cursor position at the end
130+ );
126131 }
127132
128133 var prefixControls =
You can’t perform that action at this time.
0 commit comments