Flutter doctor
```bash
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.8, on macOS 14.4.1 23E224 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.89.1)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!
```
I have form with many FormBuilderTextFields, and some of them are required - (they have validator that checks if its value empty or not), when i am trying to submit the form, calling validation - _formKey.currentState?.validate(), the latest invalid FormField is being focused instead of first one. In my case the latest is FormBuilderDateTimePicker, so when i pres "Submit", the date picker is being opened.
Expected Behavior
After validation, the first invalid Field in the tree should be focused.
Steps To Reproduce
-
Aditional information
I suppose this is not desired behaviour, but if from some unknown reason that i haven't found this is wanted. Is there at least some way to prevent date picker from opening its picker / dialog ?
Is there an existing issue for this?
Package/Plugin version
9.2.1
Platforms
Flutter doctor
Flutter doctor
```bash Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.16.8, on macOS 14.4.1 23E224 darwin-arm64, locale en-US) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.3) [✓] Chrome - develop for the web [✓] Android Studio (version 2023.1) [✓] VS Code (version 1.89.1) [✓] Connected device (4 available) [✓] Network resources • No issues found! ```Minimal code example
Code sample
```dart final _formKey = GlobalKeyCurrent Behavior
I have form with many FormBuilderTextFields, and some of them are required - (they have validator that checks if its value empty or not), when i am trying to submit the form, calling validation -
_formKey.currentState?.validate()
, the latest invalid FormField is being focused instead of first one. In my case the latest is FormBuilderDateTimePicker, so when i pres "Submit", the date picker is being opened.Expected Behavior
After validation, the first invalid Field in the tree should be focused.
Steps To Reproduce
-
Aditional information
I suppose this is not desired behaviour, but if from some unknown reason that i haven't found this is wanted. Is there at least some way to prevent date picker from opening its picker / dialog ?
I also think that this issue is related to this - https://github.com/flutter-form-builder-ecosystem/flutter_form_builder/issues/1253, where the focused were jumped to the latest input despite there were also another invalid input above No response