Flutter_form_builder: Tab/Next support

Created on 28 Apr 2019  路  5Comments  路  Source: danvick/flutter_form_builder

_(This issue may be limited to running the Simulator, but it does impact testing and development.)_

It would be great to be able to hit Tab to advance to the next Field.

Flutter does not (yet) do this out of the box: https://github.com/flutter/flutter/issues/11344
But maybe your awesome framework could? 馃槃

enhancement

Most helpful comment

Hi @awhitford,
It will be considered, especially if you put it that way ;-)

One thing to note however is that since the form includes other non-TextField input fields, it would present a problem if the next field in the form is not text-based (like a Switch for instance) and thus can request focus.

I'm not entirely sure if other kind of Widgets in Flutter can request focus and how it can be done. Let's engage on this especially if you have some pointers. This sounds like a cool addition for this package.

Thanks for your contribution.

All 5 comments

Hi @awhitford,
It will be considered, especially if you put it that way ;-)

One thing to note however is that since the form includes other non-TextField input fields, it would present a problem if the next field in the form is not text-based (like a Switch for instance) and thus can request focus.

I'm not entirely sure if other kind of Widgets in Flutter can request focus and how it can be done. Let's engage on this especially if you have some pointers. This sounds like a cool addition for this package.

Thanks for your contribution.

Note that https://github.com/flutter/flutter/issues/11344 is now done, so it'd be great to revisit this. I'm interested in having a more convenient "Next" to advance to the next text field (rather than click Done, then focus on the next field). When testing via Simulator (and not using a virtual keyboard), I also am interested in being able to advance to the next field by clicking the Tab key.

Also note that ultimately Flutter needs to be consistent with Web semantics now that Flutter Web is a thing, and form order is important for that. (Not that I tested it yet.)

THANKS!

I see lots of open issues in Flutter related to this request. It seems that many folks are complaining about it. Issue https://github.com/flutter/flutter/issues/11344#issuecomment-381312213 suggests a workaround using FocusScope. There is an example in the EditableText.onSubmitted documentation.

I just discovered that I can use textInputAction: TextInputAction.next to get the next appearing on the keyboard. Alas, clicking it does nothing -- it does not advance to the next field automatically. Is there a handler for this?

            onFieldSubmitted: (value) =>
                FocusScope.of(context).requestFocus(priceFocusNode),
Was this page helpful?
0 / 5 - 0 ratings

Related issues

gilthonweapps picture gilthonweapps  路  3Comments

droidzone picture droidzone  路  6Comments

joshuakoh1 picture joshuakoh1  路  3Comments

SachinTanpure picture SachinTanpure  路  3Comments

mattf80 picture mattf80  路  3Comments