最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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',
                      ),
}

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论