Flutter_form_builder: FormBuilderDateTimePicker gets Focus on route pop

Created on 4 Apr 2020  路  5Comments  路  Source: danvick/flutter_form_builder

Reproduce:

  • Now on page A
  • Open form page B
  • Change date value
  • Go back (Pops the screen)
  • Date time picker dialog shows in the page B

There is some issue in handling the focus of FormBuilderDateTimePicker. (may be)

bug help wanted

Most helpful comment

Thank you @shashikantleher, for bringing this to our attention.

Kindly note that this package makes use of other packages so some bugs or issues may emanate from such.

I will try to have a permanent fix, baked into the package.

@cuimingqiang thanks for your solution.
Cheers!

All 5 comments

if (_formKey.currentState.saveAndValidate()) {
FocusScope.of(context).requestFocus(FocusNode());
}

Yes thank you, @cuimingqiang . That works.

But, when a date is selected, it should automatically unfocus the date field

Thank you @shashikantleher, for bringing this to our attention.

Kindly note that this package makes use of other packages so some bugs or issues may emanate from such.

I will try to have a permanent fix, baked into the package.

@cuimingqiang thanks for your solution.
Cheers!

This should be fixed, feel free to reopen if not.

Was this page helpful?
0 / 5 - 0 ratings