I'm trying to understand form input in flutter - and how to navigate between fields with the tab key. An example on the Internet recommended the following pattern:
However, when Tab is pressed while entering text in the first field, the text of first field has the tab whitespace added to the text. Seems I'm doing flutter wrong, or there's a bug in Flutter (it clearly should be the library's responsibility to cut tab from form text when tab changes context, no?)
import 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
title: 'My app', // used by the OS task switcher
home: Material(child: content())));
}
Widget content() {
var _focus1 = FocusNode();
var _focus2 = FocusNode();
return Column(
children: [
TextField(
focusNode: _focus1,
textInputAction: TextInputAction.next,
),
TextField(
focusNode: _focus2,
textInputAction: TextInputAction.next,
),
],
);
}