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