I have this TextFormField:
TextFormField(
key: const ValueKey('lastname'),
focusNode: _lastnameFocusNode,
controller: _lastnameController,
style: const TextStyle(fontSize: Sizes.twenty),
decoration: InputDecoration(
suffixIcon: _showLastnameSuffix
? IconButton(
icon: const Icon(
Icons.close_rounded,
color: Colors.grey,
),
onPressed: () {
_lastnameController.clear();
setState(() {
_showLastnameSuffix = false;
});
},
)
: null,
border: _myOutlineInputBorder(),
hintText: tr(context).lastname,
),
inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(r'[A-Za-zs]')),
],
textInputAction: TextInputAction.done,
onFieldSubmitted: (_) {
FocusScope.of(context).unfocus();
},
minLines: 1,
maxLines: 1,
onChanged: (value) {
setState(() {
_showLastnameSuffix = value.isNotEmpty;
});
},
);
}
I have alsoe a firstname Texfield which basically built the same with textInputAction: TextInputAction.next
.
When I switch from firstname field to lastname field the keyboard action remains next
until I enter some characters and only then it switches to done
.
Same thing when I go from lastname to firstname. The keyboard action remains done
until I enter some input and only then it switches to next
.
It happens only on physical device (Samsung S20). Emulator in android studio reacts as expected.