Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
NTMS2017 opened this issue Feb 19, 2019 · 5 comments
Open

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

NTMS2017 opened this issue Feb 19, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@NTMS2017
Copy link

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
@rodydavis
Copy link
Collaborator

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?

@NTMS2017
Copy link
Author

NTMS2017 commented Mar 4, 2019

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

@codegrue codegrue added the researching trying to determine how to address this label May 14, 2020
@codegrue
Copy link
Owner

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 codegrue added the enhancement New feature or request label May 22, 2020
@codegrue
Copy link
Owner

codegrue commented Jun 3, 2020

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
Copy link
Owner

Looks like focusNodes may be the solution to implement this:

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

@codegrue codegrue removed the researching trying to determine how to address this label Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants