card_settings icon indicating copy to clipboard operation
card_settings copied to clipboard

how can I use autofocus so the form can scroll itself?

Open NTMS2017 opened this issue 6 years ago • 5 comments

Thanks again for this great plugin.

Currently the form doesn't scroll itself. so how can I use autofocus so the form can scroll itself? Also the CardSettingsListPicker or similar doesn't have auto focus.

Example I have a form as listed below. If I use autofocus for just CardSettingsText it jumps all the way down to my text. Any idea?

I also hack the CardSettingsText and add thethis.textInputAction so I can use textInputAction: TextInputAction.next. But it didn't worked.

  • CardSettingsListPicker
  • CardSettingsListPicker
  • CardSettingsListPicker
  • CardSettingsListPicker
  • CardSettingsListPicker
  • CardSettingsListPicker
  • CardSettingsText

NTMS2017 avatar Feb 19 '19 10:02 NTMS2017

There are two modes, CardSettings, and CardSettings.sectioned, which one are you using?

Could you provide some example code?

Is text input action not available?

rodydavis avatar Feb 21 '19 15:02 rodydavis

I am using CardSettings and autofocus is not working properly. Also I need to clear the default value of text field when user tabs on text field... Any help please

NTMS2017 avatar Mar 04 '19 08:03 NTMS2017

It appears flutter only provides autofocus for text fields:

https://flutter.dev/docs/cookbook/forms/focus

I am wondering if a hidden text field next to the pickers could be tabbed through, and tabbing a second time could display the dialog. I will do some reading to see if there is an expected behavior for material forms.

codegrue avatar May 15 '20 00:05 codegrue

I'm kind of at a loss on this one. Would autofocus on a picker automatically pop up the dialog? The closing that would pop up the dialog for the next one?

codegrue avatar Jun 03 '20 20:06 codegrue

Looks like focusNodes may be the solution to implement this:

https://api.flutter.dev/flutter/widgets/FocusNode-class.html

codegrue avatar Jun 17 '20 17:06 codegrue