flutter - TextField is automatically selected when start typing, causing the next letter to overwrite the existing text - Stack

I am experiencing an issue with TextField in Flutter 3.27.1 while running a desktop application on macO

I am experiencing an issue with TextField in Flutter 3.27.1 while running a desktop application on macOS 15.3.1. When I start typing in a TextField, the entire text gets selected automatically, causing the next keystroke to overwrite the existing content instead of appending to it.

for reference image is from the app. (.png) how to solve this issue.

steps to reproduce

  • Create a Flutter desktop application on macOS.
  • Add a simple TextFormField widget.
  • Run the app and type some text in the TextField.
  • Start typing again, and you’ll notice that the existing text is selected automatically, leading to overwriting.
{
    TextFieldWidget(
                        controller: NotificationFormControllers.userSearchController,
                        bgColor: appColor.pureWhiteAndBlack,
                        doOnChanged: (text) {
                          context.read<NotificationControlBloc>().add(UserSearch(
                              query: text, userList: widget.data.userName.split(',').toList()));
                        },
                        hintText: 'Search User',
                      ),
}

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745154243a4614019.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信