I have a problem with TextFormField using TextInputAction.next.
When I'm using suffixIcon the focus is on suffixIcon and not on the next field in my form.
My solution was to add a Focus
widget to my suffixIcon and set the flags canRequestFocus
and descendantsAreFocusable
to false.
Example:
Widget _suffixIcon() {
return Focus(
canRequestFocus: false,
descendantsAreFocusable: false,
child: Icon(Icons.person), //Any icon or a custom widget
);
}
TextFormField(
decoration: InputDecoration(suffix: _suffixIcon()),
//...
)